Tshirtbooth onscreen control help with your template

kirklandkirkland Removed Posts: 268
edited November -1 in Working with GS (Mac)
hi

how are you tshirtbooth. i have recently added onscreen controls to my game which has worked very well and has worked. but when i came to adding the constraints like you did for me into my game with the onscreen controls the constraint does not work. it only works when i am moving left. but not right, up or down. please can you help. i need your help.

Comments

  • kirklandkirkland Removed Posts: 268
    ok can i do it later please. thank you for answering. i will get back as soon as possible. what rules do you need though
  • kirklandkirkland Removed Posts: 268
    movement (for arrow buttons)

    rule

    actor receives event, touch, is pressed

    (change attribute)
    game.up to 1 (game.up is an integer)

    rule

    actor receives event, touch is released

    (change attribute)
    change attribute game.up to 0

    Actor which moves when arrow buttons are pressed

    rule

    attribute game.up = 1

    move direction 90 at a speed of 150

    THIS IS BASICALLY THE SAME FOR ALL DIRECTIONS AND ARROW BUTTONS.

    The bar actor (which is constrained to the actor which moves)

    group

    (change attribute)
    self.innit.angle to vectorToAngle( self.Position.X - game.HeroX , self.Position.Y - game.HeroY )

    (change atrribute)
    self.init rotation to self rotation

    (constrain attribute)
    self.rotation to game.herorotation + self.initrotation

    (constrain attribute)
    self.distancefrom to magnitude( self.Position.X - game.HeroX , self.Position.Y - game.HeroY )

    (constrain attribute)
    self.position.x to game.HeroX +cos( self.Init Angle + game.HeroRotation )* self.Distancefrom

    (constrain attribute)
    self.position.y to game.HeroY +sin( self.Init Angle + game.HeroRotation )* self.Distancefrom

    rule

    actor receives event touch is pressed

    (constrain attribute)
    self.position.x to game.mouse.position.x

    (constrain attribute)
    self.position.y to game,mouse.position.y

    (constrain attribute)
    self.position.x to game.herox

    (constrain attribute)
    self.positio.y to game.heroy

    (THE TRIANGLE ACTOR) and( THE ACTOR WHICH MOVES WHEN ARROWS ARE PRSSED) this is the actor which the bar is constrained

    (constrain attribute)
    game.herox to self.postion.x

    (constrain attribute)
    game.heroy to self.position.y

    (constrain attribute)
    game.herorotation to selfrotation

    thank you for helping and by the way the capitals is so you can understand it more thank you
  • kirklandkirkland Removed Posts: 268
    bump
  • kirklandkirkland Removed Posts: 268
    bump
  • kirklandkirkland Removed Posts: 268
    bump i am looking at uptimistik and tshirtbooth please can you help
  • JohnPapiomitisJohnPapiomitis Member Posts: 6,256
    so your asking the same rotation constrain question again...
  • kirklandkirkland Removed Posts: 268
    Guys. You have to understand this, this is the hardest thing i have ever came across. Please help me and then once you have helped and it is fixed then no more questions will be have to asked about this. Please help. I
  • kirklandkirkland Removed Posts: 268
    I also want to point out it is not the same.
  • wormilwormil Member Posts: 127
    I have no idea what you are asking for, or what you want to accomplish.

    I will say this, if some one asks you for code, and you write:
    THIS IS BASICALLY THE SAME FOR ALL DIRECTIONS AND ARROW BUTTONS.
    has no meaning to anyone. "Basically the same but different" says to me a monkey magically typed random stuff while you were sleeping and we'll never know what it was, or why your code doesn't work.

    I'm going to offer you a bit of insight on how I solve anything that needs rotation:
    Sohcahtoa. That crazy ass indian saves me every time. Draw a picture of a vector coming from your X/Y axis, label theta under the vector, stuff an arc to show it's an angle, and use sohcahtoa.
  • wormilwormil Member Posts: 127
    Also, is your game some sort of man with a stick with a triangle at the end and you're going to stab a Piñata?
  • kirklandkirkland Removed Posts: 268
    um no. Please may i send it to you and everything will become clear. if not never mind i will try and get a screenshot of what you said in a minute
This discussion has been closed.