need some help aiming when the scene is bigger than default

birkulesbirkules Member, PRO Posts: 29
edited November -1 in Working with GS (Mac)
hi everybody great forum and youtube videos from tshirtbooth! im on my first game so im not the best;) i was wondering cause i have made a canon that aims and get its power from where your finger are on the screen kinda like the one on the template,
but i have many canons so when you shoot and hit one canon you can shoot from that one instead, so my problem is when the canon is outside the default scene size, and the camera needs to follow the canon in use the controls doesnt work properly and im not sure how to make it calculate the canons position and then make that work with the aiming and power.
hehe hope you guys understand what i mean
any help would be great:)

Comments

  • InLikeFlynnInLikeFlynn Member Posts: 171
    sYou could try making another actor besides the cam and cannon to keep track of which cannon is active. Give each cannon a self.num attribute, then have a rule that sets some global attribs to the cannon's x, y. say...

    When self.num = activeNum
    change globalX to self.position.x
    change globaly to self.position.y

    Then you could have the cam interpolate to that position whenever it changes, and you can set the origin of your physics gameplay to the globalX and globalY attribs
  • JohnPapiomitisJohnPapiomitis Member Posts: 6,256
    yeah what geoffB said should be pretty spot on for you, and u can tweak that to your needs.

    keep in mind you might also need to add a offset for the camera for when your using touch to aim canons outside the original scene size

    theres a great video by tsb in the cookbook for that

  • birkulesbirkules Member, PRO Posts: 29
    great! made it work
    A big thanks to both of you!
Sign In or Register to comment.