Release

DATA MANIPULATION with “COPY” (or Smiley TOY)

2

was8bit 2019-07-02 05:32 (Edited)

There are 2 intro screens...
- FIRST intro will buzz and automatically goto the second intro
- SECOND intro screen shows dancing dots... TAP to exit this intro

THEN you get the SMILEY TOY....

- HOLD DOWN to see a new expression

- LET GO to return to bored smiley....

... (oh, and also this an example that demonstrates how to use COPY to manipulate character data during gameplay)


was8bit 2019-07-02 05:38

By default, character#0 is a “blank” so editing it cause your edit to change all blanks... but let’s say you use character#1 for grass and put grass in lots of places... by using this trick, and copying other cells into character#1 space, then you effectively automatically animate ALL of your grass cells without having to change anything in the background.... you are changing the graphic for all character#1’s on the screen.. :)


Timo 2019-07-02 08:10

This can be used to animate some tiles on a map, for example water or fire etc.


was8bit 2019-07-02 08:57 (Edited)

Yes...

So, if you only have 1 cell tile that you want animated, the easiest method is to place a new character into that cell ... so if you are using character 10,11,12 for the three animation frames, rotate putting different ones on the background
CELL X,Y,10
CELL X,Y,11
CELL X,Y,12
... repeat..

BUT, if you have a river of lava, and use the lave tile down the volcano and then across the entire bottom of the screen, that is a lot of tiles to manually change out all those cell tiles to create the animation process.... sooo....

Take one unused character, and put all the different animation graphics into it.. so following the above example, if your lava animations are in characters 10,11,12... let’s say character 17 isn’t being used.. draw something in #17 just so you know it’s going to be an animated tile, and with BG Designer use character#17 on your background for the lava flow...

And then in your code, you alternate copying characters 10,11,12 into character 17...


was8bit 2019-07-02 09:02 (Edited)

REM # OF DATA BITS IN A CHARACTER
CHARDB=16

REM CHARACTERS ADDRESS LOCATION DURING GAMEPLAY
CHARADD=$8000

REM VISIBLE NUMBER IS THE ACTUAL CHARACTER#
COPY CHARADD+10*CHARDB,CHARDB TO CHARADD+17*CHARDB
COPY CHARADD+11*CHARDB,CHARDB TO CHARADD+17*CHARDB
COPY CHARADD+12*CHARDB,CHARDB TO CHARADD+17*CHARDB

But with extra code that spaces these out timewise... if the main loop has one WAIT VBL, then each cycle thru the loop is 1/60 of a second...... to see all 3 tile animations in one second, you put in code to wait 20 loops between each tile swap...


was8bit 2019-07-02 09:05 (Edited)

So, rather than the manual way of replacing all the background tiles with new characters... you are replacing the graphic for character#17 with new graphics, which means ALL cells with character#17 will instantly get the new graphics :D


was8bit 2019-07-02 09:10

I can make an example showing a scene with different animations...


was8bit 2019-07-02 10:11

Animated background...

https://lowresnx.inutilis.com/topic.php?id=566


Log in to reply.