Help required with scrolling around a cannon physics game

arcticsunrisearcticsunrise Member Posts: 159
edited November -1 in Working with GS (Mac)
Hi there hope you can help me out

I have a canon physics game with a nice wide screen and everything is working lovely - the camera follows the shot etc.

I have implemented a zoom screen button which works nice but im trying to make a little swipe actor so you can scroll the screen about from left to right.

I have tried it 2 ways now and both ways have different problems but neither quite work

Both ways have a swipe actor that registers which way you have swiped and transfer this to a camera eye actor

In the camera eye actor within the scene (not the prototype) i have 2 rules and each pertains to which direction you have swiped.

My first attempt was having the actor control the camera and physically move in the direction required. This worked fine but it meant that the actor moved off the screen. I tried collison etc with an invisible wall but this didnt work either. I tried min and max (maybe i got maths wrong)

Second attempt was to just ammend scene.camera.origin which makes it snap across a screen at a time. not as smooth as moving an actor with camera control but it works.

I set a rule that if scene.camera.origin.x less than or equal to 160 then set scene.camera.origin.x to -320

This worked lovely and wouldnt go any further left than my initial start but trying to get a rule so it wouldnt go any further right is a problem. I tried defining a rule when scene.width but it still carried on and on to the right

Anybody got any ideas.

Im sure i saw a tshirtbooth template for physics or maybe deepblue for sale but ive figured most stuff by myself

PS although PRO this is my first ever game using GS - im bringing in coding and logical knowledge from things such as gamemaker and getting my way around how GS does things but this little problem has me stumped.

Thanks a lot in advance

Comments

  • Nickop9Nickop9 Member Posts: 3
    I know how to scroll, i'll tell you how to scroll if you tell me how to do the pinch zoom, been wanting that one for a while
Sign In or Register to comment.