Can't Find Solution-Need Help Desperately

11XIndustries11XIndustries Member, PRO Posts: 28
edited January 2014 in Working with GS (Mac)
Here is what I have.

game.mousePosition.X to game.mousePosition.Y

Now, this works in rotating the actor, but I need the min95 and max20.

I need the cannon when touch is pressed, I will be able to rotate the cannon no more that min 95 and max20.

Any help with this is appreciated.

Comments

  • AppTacoAppTaco Member Posts: 125
    Hey there,
    Give this a try.

    Change Attribute: self.Rotation to: vectorToAngle(game.MousePositionX-self.PositionX, game.MousePositionY-self.PositionY)
  • 11XIndustries11XIndustries Member, PRO Posts: 28
    I had the code wrong. Here is what I had.

    game.mousePosition.X to game.mousePosition.Y

    Now, this works in rotating the actor, but I need the min95 and max20.

    I need the cannon when touch is pressed, I will be able to rotate the cannon no more that min 95 and max20.

    Any help with this is appreciated.
  • -Timo--Timo- Member Posts: 2,313
    edited January 2014
    constrain self.rotation to min(95,max(20,self.rotation))

    made a little template
    download link: https://www.dropbox.com/s/7p56mv5e8p3xrfz/max rotation template.zip
  • 11XIndustries11XIndustries Member, PRO Posts: 28
    Thanks. It works, but it is quite jumpy. When touch is pressed to move the cannon actor, it gets a little jumpy. This one problem is holding my progress up. I am probably going to have to pay someone to fix it.
Sign In or Register to comment.