Stopping actor from leaving the camera
Forte
Member, PRO Posts: 297
Hello everyone,
trying to make a shoot-em up game, but I don't want the main actor to leave the camera. I have tried barriers that follow at the back end of the camera, but when the actor hits it, the barrier moves. Then the actor can get out of the screen. Large problem, I went into the physics attributes and unticked the box for "moveable" then the barrier did not move at all!
Please if someone who has come up with a solution, that would be great!
Cheers, Dragokillz
trying to make a shoot-em up game, but I don't want the main actor to leave the camera. I have tried barriers that follow at the back end of the camera, but when the actor hits it, the barrier moves. Then the actor can get out of the screen. Large problem, I went into the physics attributes and unticked the box for "moveable" then the barrier did not move at all!
Please if someone who has come up with a solution, that would be great!
Cheers, Dragokillz
Comments
btw fixed rotation is on
Using that, constrain that position to some game attributes(real type).
In your ship actor add a condition on your movement rules that check that the ship isn't too far from that game attribute tracking the position of the camera.
Also make a rule that checks if the position of your ship is less than the position of the camera minus some offset. And constrain the position of the ship if that is true.
I've just added a modified Shmup so you can see this in action.
Check out http://gamesalad.com/game/play/26504
Or find it in the shared projects under 'ShootEmUp Move Fix(Demo)'
Using that, constrain that position to some game attributes(real type).
In your ship actor add a condition on your movement rules that check that the ship isn't too far from that game attribute tracking the position of the camera.
Also make a rule that checks if the position of your ship is less than the position of the camera minus some offset. And constrain the position of the ship if that is true.
I've just added a modified Shmup so you can see this in action.
Check out http://gamesalad.com/game/play/26504
Or find it in the shared projects under 'ShootEmUp Move Fix(Demo)'