Log In  
Follow
Inkcat78

Cart #satemuruki-2 | 2024-05-11 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA
3

--Instructions--
Mouse: Spring movement

BTN(1): Mode change

BTN(2) & (3): Equilibrium change

BTN(4): Gravity

BTN(5): Show text

3
0 comments



Hello! I was wondering if anybody can help me figure out why my code wont delete an object. This is my first time using del so I'm sorry if it is really obvious.

trigger:

function update_slash_p1()

for s in all(slash_p1) do
s.dx+=1

if s.dx>8
then
kill_slash_p1()
end
end

code:

function kill_slash_p1()

del(slash_p1,
dx,
frame,
flip,
damage
)

end

I also tried:

del(slash_p1,{
dx,
frame,
flip,
damage
})
end

Thank you!

3 comments



function _init()
f={}
end

function _update()
add(f,{y=1})
end

function _draw()
cls()
map()
print(f.y,58,58,8)
end

The print displays that that f.y is nil, could somebody please help?

1 comment



Is there a way to detect when time() changes? I’m trying to make a movement system where when a button is pressed a sprite moves for a certain amount of time.

3 comments