Quote: "Your code doesn't compile and I don't think you've really understood my code."
it's compile easily and don't show any error.i wrote it in AppGameKit v1.
I this is another code that I think it's similar your code.but I don't know why can't stay on ladder when up key is release.
SetDisplayAspect( 4.0/3.0 )
SetPhysicsGravity(0,4000)
spr = CreateSprite(0)
SetSpriteSize (spr,5,10)
SetSpritePosition(spr,20,60)
SetSpritePhysicsOn(spr,2)
SetSpriteDepth(spr,0)
SetSpritePhysicsCanRotate (spr,0)
spr_weight = GetSpritePhysicsMass(spr)*4000 // the weight of the sprite is simply it's mass multiplied by gravity
ladder = CreateSprite(0)
SetSpriteColor (ladder,132,197,134,255)
SetSpriteSize (ladder,8,45)
SetSpritePosition(ladder,50,60)
box = CreateSprite(0)
SetSpriteColor (box,233,75,80,255)
SetSpriteSize (box,5,-1)
SetSpritePosition(box,80,90)
SetSpritePhysicsON(box,2)
do
xpos# = GetSpriteX(spr)
ypos# = GetSpriteY(spr)
if GetRawKeyState (39) = 1
SetSpritePhysicsVelocity(spr,35,GetSpritePhysicsVelocityY(spr))
else if GetRawKeyState (37) = 1
SetSpritePhysicsVelocity(spr,-35,GetSpritePhysicsVelocityY(spr))
else
SetSpritePhysicsVelocity(spr,0,GetSpritePhysicsVelocityY(spr))
endif
endif
laddercollide = GetSpriteCollision(spr,ladder)
if laddercollide = 1
if getRawKeyState(38) = 1
SetSpritePhysicsForce(spr,xpos#,ypos#,0,spr_weight*-1)
SetSpritePhysicsVelocity(spr,GetSpritePhysicsVelocityX(spr),-35)
else
SetSpritePhysicsVelocity(spr,GetSpritePhysicsVelocityX(spr),0)
endif
endif
Sync()
loop
Quote: "
I think I get it now, Behdadsoft doesn't actually know how to get the character to jump and fall and climb ladders without using the 2d physics commands. Is that correct?"
yes, right. because at first working with 2d engines I learn work with physics and all tutorials relate to Physics.
already said seem control character (fall, jump,...) without use Physics is old method like NES and Sega games. but i hope learn this method.