Hi, I've started a simple sidescrolling shootemup. THe problem I have is just scrolling. I want the screen to move towards the right the whole time, and the ship, when the screen almost goes past him, he gets "pushed" so that the ships is always in the screen. This is in all shootemups, but I cant seem to fix this.
Thanks in advance/ Tobbe
use an invisible detector at the edge of the screen you want it pushed from, and always set it's x position to x of the object plus something. and always set the scrolling position to a certain position from the detector.
Then, if the ship is overlapping the detector, set it's position to the same rate as the detector x moving speed
ok thanks, I will try that. Just before I do, is this for the actual game edge (ie size of the entire map) or just the edge of what you see? cus I was aiming for the later...
its the edge of what you see. If you type in something like "x left frame" that means the left edge of what you can see. Its not the whole frame size, just the scrolling area
Actually, thinking about it, my event could be modified to:
Position of X(ship) is lower or equal to x left frame:
then::
Set x position of x(ship) to x left frame + 4
-----
So if the ship starts to disappear off the left visible edge, then it will automatically be placed just after it. Good luck
Circy: I tried it your way, precisley as you wrote it. but the screen goes past him and he does nothing... do you know what I have done wrong?
here is the coding:
http://www.gazler.com/users/ifrit//tgf.gif
oh, now I understand what I did wrong. Thanks for the help, it works now, but its a bit buggy (the ship jumps constantly). If anyone got any ideas on how too fix that I'll be glad, but otherwise, thans for the help so far!
You also forgot "hate leads to suffering", i.e. the suffering of those 12-year-old punks when I subscribe them to certain adult magazines... in the post. "What's this, son?" Oh, the hilarity.