Page 1 of 1

Scrolling problems

PostPosted: Sat Dec 31, 2005 3:58 am
by Joat_Mone
Hi,

I'm trying to make a game where the view scrolls with the player.

(view.x = Thief.x - 120;
view.y = Thief.y - 160;
That works no problem)

Here's the catch. I want the view to stop when it gets to the edge of the "world", but let the player (the Thief) keep walking up to the edge of the screen. Kinda like the old verticle space shooters where you can move to the side, and the screen scrolls to a point, and your ship will move up to the edge of the screen.
I cannot have the view stop because of a collision because that is not available to the view object. I can have the Thief stop because of a collision, but then the view is to far over.

Any thoughts, ideas, suggestions, snyde comments?

PostPosted: Sat Dec 31, 2005 11:13 am
by bitchkiller
Try the following:
Make the player parent of view. The view will follow him. Then when he colllides with the edge of the world put a collison event on him and cahnge the parent of view. It stops following him and he can go out of the screen. 8)

Not quite the solution

PostPosted: Sat Dec 31, 2005 10:17 pm
by Joat_Mone
I have done that, but that isnt what I'm trying. It follows him all the way so you can see the black border around the area you can walk. What I did was make an object the height of the area (named it "Border"), and make another object near the edge. I made both of them transparent so you couldnt see them. I then put an event where if the Thief collided with the "Border" object, the view would change to the static object. It works. I wish there was a better way, but atleast it works.

Thanks bitchkiller (never thought I would say that sentence....)

Note. If you have the object one large square of one color. You can set the alpha channel to almost fully transparent. I noticed that if it is fully transparent the collision doesnt happen.

PostPosted: Sat Dec 31, 2005 10:53 pm
by mrdark7734
You can also use filled regions or wire frames for this instead of an actual picture with the transparency set real high. It will save a small amount of room when you compile.