How to stop my view from going past a wall?

Talk about making games.

How to stop my view from going past a wall?

Postby ShingingDB » Sun May 20, 2007 3:06 am

In my game, I use a centerView that follows my actor. When I move my actor close to the end of the wall, I see everything thats after it. And I dont want that to be in there. I want my view to just stop when it reaches the wall.

How do I do that? I've tried a Collision event between the centerView and the wall, but it doesnt work.
ShingingDB
 
Posts: 43
Joined: Sun Apr 01, 2007 1:31 am
Score: 0 Give a positive score

Postby d-soldier » Sun May 20, 2007 4:13 am

If your centerview[following your player] is what the view is following, then naturally the VIEW will go past the wall, being centered on the center view. You need to add some filled-region actors, and have them extend into the level a ways (gonna take some playing with) and have the centerview collide with them... There could be a conflice depending on how the centerview is scripted to follow the actor though... hmm... see if that works, and if not, you may need to upload the zip and have someone play with it...
User avatar
d-soldier
 
Posts: 703
Joined: Sun Apr 08, 2007 2:13 am
Score: 61 Give a positive score

Postby pavel329 » Sun May 20, 2007 6:40 am

but filled regions make the game way too choppy.



You could take his way.
There is even a tutorial.

You can just put some thing on the other side of the wall.
Like ground.
Or ceiling.
Just look at a zelda game.
They made it look like there was ceiling in it.
Drugs r bad.
Mgaay?

Image
User avatar
pavel329
 
Posts: 269
Joined: Thu May 25, 2006 2:05 pm
Location: Behind you
Score: 5 Give a positive score

Postby d-soldier » Sun May 20, 2007 6:50 am

I have tons of filled regions in all my projects, and they are never choppy... Your talking about a filled-region-actor,the blue rectangle, right?
User avatar
d-soldier
 
Posts: 703
Joined: Sun Apr 08, 2007 2:13 am
Score: 61 Give a positive score

Postby pavel329 » Sun May 20, 2007 7:19 am

yes.
And its not choppy.
Its just that its like a slide show.
Your walking until you hit the region then the entire level changes.
It seems choppy when you run.
Drugs r bad.
Mgaay?

Image
User avatar
pavel329
 
Posts: 269
Joined: Thu May 25, 2006 2:05 pm
Location: Behind you
Score: 5 Give a positive score

Postby Sgt. Sparky » Sun May 20, 2007 1:58 pm

just make the centerview a Big filled actor(the size of the view, make sure you match the edges!),
when it collides with a wall have a physical responce repeated,
the view should be parented to the filled actor,
when the filled actor moves the code should look somthing like,
Code: Select all
angle = direction(x + width / 2, y + height / 2, playername.x, playername.y);
directional_velocity = distance(x + width / 2, y + height / 2, playername.x, playername.y);

:D
Image
Random Links:
viewtopic.php?p=19474#19474
Right now (10/14/2009) I'm working on some C++ projects, but I might be able to help if you have some Game Editor questions. :)
User avatar
Sgt. Sparky
 
Posts: 1850
Joined: Sat Oct 07, 2006 5:28 pm
Location: Somewhere out there, beneath the pale blue sky...
Score: 236 Give a positive score

Postby ShingingDB » Sun May 20, 2007 9:30 pm

Woops. I forgot to add that I use a collision event between the wall and my player for a wall.
ShingingDB
 
Posts: 43
Joined: Sun Apr 01, 2007 1:31 am
Score: 0 Give a positive score

Postby Sgt. Sparky » Tue May 22, 2007 2:22 pm

xD
that is your problem! :lol:
Image
Random Links:
viewtopic.php?p=19474#19474
Right now (10/14/2009) I'm working on some C++ projects, but I might be able to help if you have some Game Editor questions. :)
User avatar
Sgt. Sparky
 
Posts: 1850
Joined: Sat Oct 07, 2006 5:28 pm
Location: Somewhere out there, beneath the pale blue sky...
Score: 236 Give a positive score


Return to Game Development

Who is online

Users browsing this forum: No registered users and 1 guest

cron