-
Scrolling Top Down
I've read several posts about parallax scrolling, but I'm not sure how to handle scrolling for what I'm after. Lots of posts say scrolling is easy, but I think what I'm trying to do is a bit of a challenge.
I have the surface of the world as a 1280x1024 texture with the game in a top down view. The player controls a ship that flies around the world which I would like to be made up of 5-6 of these textures.
The ship needs to find 4 actives scattered around the huge world. If they fly off either edge they should circle around to the other side of the map, i.e. constantly scrolling.
http://img516.imageshack.us/my.php?image=screenshothelplo1.jpg
What is the best route to take with this approach?
Should I copy and paste backgrounds at runtime to tile together if I need a bigger or smaller world?
How do I get the ship the fly so far South that it appears at the top of the board without any major noticeable change?
Thank you,
Tom / Doc4
-
Re: Scrolling Top Down
Still looking for some ideas on this one.
Tom / Doc4
-
Re: Scrolling Top Down
+spaceship->test position->leaves the play area
-spaceship->movement->wrap around play area
-
Re: Scrolling Top Down
Thank you for the easy suggestion.
Unfortunately, it comes with two issue that I have yet to resolve.
1) Warping to the other side produces an obvious delay in the image only due to the fact that the entire ship must cross in from the edge before the image is displayed. The end result is a second of nothing on the screen before the ship magically appears already it's full width in.
2) More importantly, warping does not seem to work at all if the screen is centered on the ship.
Crossing my fingers that there's a friendly user out there with some input.
Thanks,
Tom / Doc4
-
Re: Scrolling Top Down
What I've done to simulate this kind of thing in the past is have the outer screen-width border duplicated on the top and bottom, left and right of the screen, then detecting for the player being a half-screen away from the edge and then warping to the other side of the playfield. If done in the right places and the events are in the right order, this can be pretty much undetectable.
If you've got variable things like enemies that will be in view at the time, though, that's something to think about.
-
Re: Scrolling Top Down
Great suggestion David. Thank you.
I made my virtual sizes 4x that of the window size, positioned the ship when within half a window's size to the other side. My other actives I just spawned at coordinates that will never be seen within half a window's screen.
I still have a flicker every single time the ship is jumped either X or Y with the screen following it. If I could get rid of this, then the illusion would be complete. Maybe have the old ship fire off some effect to mask the jump?
Also, I'd like to have a Distance to Target on my little HUD. Using the ADO, it works just fine except if you're at the left edge of the screen and the Target is on the right side. It will tell you you're 3000 away when you're only 800 once you warp through the other side. Any way to handle this mathematically? Create a duplicate of each object outside the boundries of the virtual window? Having the ADO constantly check the distance to the target is one thing, but constantly checking the distance to target, distance to duplicate outside of virtual window, find the closest and display the result...that sounds like plenty o' processing power.
Anyways, thanks again. This really helped put the game into focus. Once I get the damnable Zip Object to work with my 15-60mbs of array files, then I'll know for sure the project is possible.
Tom / Doc4
edit: Wait...to find the distance, I think I would have to have the Target active in the play area, and 1 outside the play area in all four directions...I think. Then constantly check the distance of all five and give the closest. Eep!
edit#2: Flicker gone by messing around with the sequence of jumping position and having screen follow the ship. Works perfectly. Now I've got a globe for the player to fly around in.