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.