Page 1 of 1
How to stop my view from going past a wall?
Posted:
Sun May 20, 2007 3:06 am
by ShingingDB
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.
Posted:
Sun May 20, 2007 4:13 am
by d-soldier
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...
Posted:
Sun May 20, 2007 6:40 am
by pavel329
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.
Posted:
Sun May 20, 2007 6:50 am
by d-soldier
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?
Posted:
Sun May 20, 2007 7:19 am
by pavel329
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.
Posted:
Sun May 20, 2007 1:58 pm
by Sgt. Sparky
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);
Posted:
Sun May 20, 2007 9:30 pm
by ShingingDB
Woops. I forgot to add that I use a collision event between the wall and my player for a wall.
Posted:
Tue May 22, 2007 2:22 pm
by Sgt. Sparky
xD
that is your problem!