How To

Character moving, and trying to understand graphics.

1

kusogaki 2021-02-01 02:40

I've been using LowRes NX for a while now, I am pretty much familiar with most of the basics. I want to be able to make 2D games.

I know how to make my sprites show up, but I always mess up trying to get the sprite to be controllable (It just doesn't go the way I want it to).

Also, I want to know how to make sprite animations. I have a small running animation setup, but I don't know how to make it work.

I can't understand the manual very well, so I'm still trying to figure out graphics on my own, but it just always doesn't go the way I want them to be.

Sprites.nx | Open in app
2021-02-01 02:40

GAMELEGEND 2021-02-01 06:00

this is how you control sprites with the gamepad

now you don't have to use SUB MOVE like I did
you can just place the following chunk of code in the DO LOOP

IF UP(0) THEN
DEC Y
END IF

IF DOWN(0) THEN
INC Y
END IF

IF RIGHT(0) THEN
INC X
END IF

IF LEFT(0) THEN
DEC X
END IF

SPRITE 0,X,Y,1


GAMELEGEND 2021-02-01 06:05 (Edited)

the reason for the 0 in UP(0) is because there is one gamepad
if you made 2 gamepads GAMEPAD 2 then it would be UP(1) (just incase you didn't know)

so the way this works is it constantly checks to see if and what part of the gamepad was touched and then increases or decreases X and/or Y by one and the sprite is able to go diagonally because I'm using 4 different if statements

the second SPRITE 0,X,Y,1 will constantly update the sprites X and Y postion
and that's basically it


GAMELEGEND 2021-02-01 06:29

yep this is how you do it


GAMELEGEND 2021-02-01 06:32

I know how to do sprite animation but there are other people who can explain it a lot better than I can

its not complicated I just can't explain well for some reason


qwaffe 2021-02-01 07:04

im guessing for sprite animation you can do something like this:

say the frames of the sprite range from 1 to 8

for every frame, add 1 to the accumulator which loops from 1-8, and change the sprite according to that number.

F=1
DO

...

SPRITE 0,X,Y,F
ADD F,1,1 TO 8
WAIT VBL
LOOP


was8bit 2021-02-01 07:44

I will post my contribution tomorrow... (too tired for now)...


was8bit 2021-02-01 14:41

Ok, got something for you.. hope it is helpful... post any questions :)


Log in to reply.