Discussion

was 8bit, I have a question

0

japanese 2020-06-19 14:55

SPRITE 0,,,2
SPRITE.A 0,(1,,,,)
FOR I=1 TO 15
SPRITE I,,,1
SPRITE.A I,(1,,,,)
NEXT I

What are you doing in this program?

Pong.nx | Open in app
2020-06-19 14:55

was8bit 2020-06-19 16:30 (Edited)

Oops, sorry... that was an older game ...this is obsolete code... i just now updated it :)

SPRITE 0,,,2
SPRITE 0 PAL 1
FOR I=1 TO 15
SPRITE I,,,1
SPRITE I PAL 1
NEXT I


was8bit 2020-06-19 16:33 (Edited)

In the command SPRITE sprNum,xPos,yPos,charNum

You can omit the following entries if no changes are needed:
XPos
yPos
charNum

Using SPRITE sprNum,,,

"IS" valid, but changes nothing, so you would add any # to what you wanted to change


was8bit 2020-06-19 16:37 (Edited)

SPRITE sprNum PAL # FLIP #,# PRIO # SIZE #

Will also changes things...
these are used without commas between the commands
they may be used in any order
You may choose not to use any command, you may use as few as only one command

When you do not use a command, 0 is assumed or the last setting you inputed is used


was8bit 2020-06-19 16:42

You cannot add the extra commands to the first one... example

SPRITE 1,0,0,2 PAL 1

Is incorrect...

SPRITE 1,0,0,2
SPRITE 1 PAL 1

Is correct


was8bit 2020-06-19 16:45 (Edited)

SPRITE sprNum,xPos,yPos,charNum

Creates a sprite, or changes the position and/or chacter imaged used for the sprite

The charNum will reference the top/left corner of the sprite, using character images used to create the sprite... if your sprite size is SIZE 1 this means it is 2x2 characters big...

If you have

SPRITE 1,,10
SPRITE 1 SIZE 1

Then NX will use character image #'s...
10,11
26,27

To assemble the sprite's final look :)


was8bit 2020-06-19 16:54

For the biggest sprite size...

SPRITE 1,,10
SPRITE 1 SIZE 3

Characters used..

10,11,12,13
26,27,28,29
42,43,44,45
58,59,60,61

Are used from your CHAR DESIGNER, page 1... to create the sprite's final image

Changing SPRITE 1,,,6

Changes the entire look of your sprite, which now its upper left corner points to charNum 6, and NX changes the look of your sprite... great for animation ;)


was8bit 2020-06-19 16:58 (Edited)

This pong game may not be usefull code wise, and i am using pure math to dectect ball contact with paddle, and tricky sprite tricks ...

... later on i will post a very simple pong game here so you check out code that doesn't use any "TRICKS" :)


was8bit 2020-06-20 05:24

:)

Half Pong.nx | Open in app
2020-06-20 05:24

was8bit 2020-06-20 05:25

This is an incomplete game, but should show you enough to get started :)


Log in to reply.