graphics!!!!

2

WhyCanInotThinkOfAName? 2021-03-21 18:38

I DID A GRAPHIC. YEEAHHAHAHAHAH! :)

graphics.nx | Open in app
2021-03-21 18:38

G-9 2021-03-22 06:25

Thats awesome


was8bit 2021-03-22 06:31 (Edited)

Very nicely done... graphic made, and can be moved as well... nice code with one main game loop, well done :)

Now, explore changing colors...

Then, explore animation ;)

Controlling changes in time can be done many ways... i like my method as the math is easier... your main game loop is timed by NX and then one WAIT VBL (or WAIT 1) for 60 graphic frames per second... or each loop is 1/60th of a second... exactly...

So...

PALWAIT=(PALWAIT+1) MOD 15
IF PALWAIT=0 THEN
ADD IPAL,1,0 TO 1
SPRITE 1 PAL IPAL
END IF

Is one way to time the change in color or anything...

MOD 15 means ever 15 cycles, or 15/60 or 1/4th of a second, or 4times a second... with MOD 1 being the fastest, and MOD 60 being every 1 second...


was8bit 2021-03-22 06:36 (Edited)

My method also allows for easy odd settings, like...

PALWAIT=(PALWAIT+1) MOD 15
IF PALWAIT=0 THEN SPRITE 1 PAL 0
IF PALWAIT=5 THEN SPRITE 1 PAL 1
IF PALWAIT=8 THEN SPRITE 1 PAL 0
IF PALWAIT=12 THEN SPRITE 1 PAL 2


qwaffe 2021-03-23 01:08

PALWAIT = -1
ADD PALWAIT,1,0 TO 15

is a thing as well


was8bit 2021-03-23 02:11

True, true.. but mine doesnt require initializing PALWAIT with a value first... but yours may process faster...


WhyCanInotThinkOfAName? 2021-03-24 03:16

Thank you Was8bit!


was8bit 2021-03-24 04:26 (Edited)

Glad to be helpful :)


Log in to reply.