Omnimaga

Calculator Community => TI Calculators => Axe => Topic started by: epic7 on November 24, 2011, 09:55:36 pm

Title: HELP with game
Post by: epic7 on November 24, 2011, 09:55:36 pm
Im making a game where a guy has a grappling hook and swings from the ceiling.

I had a lot of determination, but not getting the code right mixed with the annoying perpetual yells of my brothers has made me give up eventually.

Every thing pretty much works. Except for the line that is the rope of the grappling hook

(indented from croquette)

   If (getKey(54))*((H=0)+(H>40))*(B=0) ;Checks if ready
      X->S ;Stores X,Y, and Right/left to a new variable
      Y->T
      R->theta
      Repeat pxl-Test(S,T) ;S and T are the rope's top coordinates
         T--
         If theta ;If going right
            S++
         Else
            S--
         End
      End ; That moves the top of the rope up and to an angle in the player's facing direction until it hits something
;Some other stuff
End

It later draws the line with
Line(X+7,Y,S,T)

Any more code needed, just ask.
Help is desperately needed would be highly appreciated :)

The problem, is that when the player is in the air and grapples to the ceiling again, S seems to fall behind X, instead of going in front of it.

Also, sometimes it grapples to the floor, but that probably needs some signed << >> stuff to fix.