You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
if btn(2) then
if p.vx > -1 then
p.vx=p.vx-0.14
end
end
if btn(3) then
if p.vx < 1 then
p.vx=p.vx+0.14
end
end
if p.vx>0 and tilr==0 or p.vx<0 and till==0 then
p.x=p.x+p.vx
end
if till==0 and tilr==0 then
p.vx=p.vx/1.14
else
p.vx=0
end
if tild == 0 and tilrd==0 and jump == 0 then
if p.vy<1.625 and t%2==0 then
p.vy=p.vy+0.125
end
p.y=p.y+p.vy
fall=1
elseif jump==0 then
p.vy=1
fall=0
else
fall=0
end
if fall==0 and btn(4) then
if jump==0 then
p.vy=-2.75
end
jump=1
end
if jump==1 then
p.y=p.y+p.vy
p.vy=p.vy+0.125
if p.vy==0.125 then
p.vy=0
jump=0
end
end
t=t+1
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
The bug is the wall jumping and going inside of an wall
Code : `t=0
p={}
p.x=60
p.y=60
p.vx=0
p.vy=1
cam={}
cam.x=0
cam.y=0
jump=0
fall=0
function TIC()
cls(08)
till=mget((p.x-1)//8,p.y//8)
tilr=mget((p.x//8)+2,p.y//8)
tild=mget((p.x//8),(p.y//8)+2)
tilrd=mget((p.x+15)//8,(p.y//8)+2)
map(cam.x,cam.y,30,17,0,0,0)
spr(256,p.x,p.y)
spr(256,p.x+8,p.y)
spr(257,p.x,p.y+8)
spr(257,p.x+8,p.y+8,1,1,1)
-- Movement and Collisions :
if btn(2) then
if p.vx > -1 then
p.vx=p.vx-0.14
end
end
if btn(3) then
if p.vx < 1 then
p.vx=p.vx+0.14
end
end
if p.vx>0 and tilr==0 or p.vx<0 and till==0 then
p.x=p.x+p.vx
end
if till==0 and tilr==0 then
p.vx=p.vx/1.14
else
p.vx=0
end
if tild == 0 and tilrd==0 and jump == 0 then
if p.vy<1.625 and t%2==0 then
p.vy=p.vy+0.125
end
p.y=p.y+p.vy
fall=1
elseif jump==0 then
p.vy=1
fall=0
else
fall=0
end
end
`
Beta Was this translation helpful? Give feedback.
All reactions