Keys

Z - Toggle the alive/dead state
X - Show/hide the logic


Code

Below is an implementation of the code in the above explanation. For it to be useful, you need two different sprites in #001 and #002.

function _init()
 a=true --alive?
 b=1    --sprite:alive
 c=2    --sprite:dead
 x,y=60,60
end

function _update()
 if (btnp(4)) a=not a --flip/flop a
end

function _draw()
 spr(a and b or c,x,y)
end

Comments

Log in with itch.io to leave a comment.

(+1)

Cool, thank you for sharing!

(+1)

This is very new stuff for me. Thanks for the info !

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy