Scrolling problems

Non-platform specific questions.

Scrolling problems

Postby Joat_Mone » Sat Dec 31, 2005 3:58 am

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?
Joat_Mone
 
Posts: 37
Joined: Mon Mar 01, 2004 9:13 pm
Score: 0 Give a positive score

Postby bitchkiller » Sat Dec 31, 2005 11:13 am

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)
bitchkiller
 
Posts: 3
Joined: Fri Dec 30, 2005 11:04 am
Score: 0 Give a positive score

Not quite the solution

Postby Joat_Mone » Sat Dec 31, 2005 10:17 pm

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.
Joat_Mone
 
Posts: 37
Joined: Mon Mar 01, 2004 9:13 pm
Score: 0 Give a positive score

Postby mrdark7734 » Sat Dec 31, 2005 10:53 pm

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.
User avatar
mrdark7734
 
Posts: 21
Joined: Thu Aug 25, 2005 12:49 am
Location: Texas (where we're crazy enough to shoot a president)
Score: 0 Give a positive score


Return to General

Who is online

Users browsing this forum: No registered users and 1 guest

cron