Forums

Topic: Petit Computer

Posts 2,621 to 2,640 of 9,620

MrSirr

alright now it wont let me do anything else since its in a loop. How do I fix that? How do I make it do other stuff BESIDES THE FRIGGIN LOOP, UGH.

MrSirr

bigdog00

if your done with the loop, use the "goto @(whatever)" to do something else

I like petit computer! Asphault 3d is awesome!

3DS Friend Code: 0473-8697-6288 | Twitter:

Zennyboiz

Trying to get into programming and came across this a few days ago. Finally got the money to get it, but I'm currently on the fence about it.

Zennyboiz

Twitter:

Pixelrobin

@ZennyBoiz GET IT. YOU WILL NOT REGRET YOUR CHOICE.

Everybody do a chirp. CHIRP.

3DS Friend Code: 3007-9228-5126

MrSirr

bigdog00 wrote:

if your done with the loop, use the "goto @(whatever)" to do something else

Im never done until u die, its one of those survival games. So it constantly goes up...now what?

MrSirr

Pixelrobin

@Mrsirr that was just an example. Just use LOCATE and put it wherever. If you have a main game loop, then put that code there (Without the @LOOP stuffs)

Everybody do a chirp. CHIRP.

3DS Friend Code: 3007-9228-5126

ramstrong

Discostew wrote:

@Gimmemorecoinz

My mistake. I was thinking of INSTR, which was already explained. I was on a 10hr drive, so I wasn't all there.

Wow. 10HR drive. Doesn't sound like a relaxing vacation. I'm a driver so I regularly do 12+ hour drive. It can get tiring sometimes.
BTW, did you analyzed the picture format? I'm thinking that it would be a good way to transfer data from Nintendo DSi to PC. I'm thinking it's raw 8 bit format 256x192. Is that right? Does the image has header files and does it use a compression at all? RLE maybe?

randomouscrap98 wrote:

@mystman12 I think you've got a little bit of weirdness going on with the logic behind RESTORE and such. Here's how it works:

You put a bunch of data in a DATA section somewhere, like you did in your program. Then you give it a title.

Excellent explanation, randomous! Do you mind reposting this in tutorial thread?

Bluerobin2 wrote:

is there a specific reason that the icon chejing variable has parenthesis? I dislike the fact that smileboom seemed to just rush through that feature. :/

Edit: I mean iconchk()

It's the difference between command and function. Function returns value. Iconchk() returns a number, right? That's why it's a function, and uses parenthesis.

Edited on by ramstrong

Petit Computer Journal
Old site http://ramstrong.blogspot.com

Let's just call a spade, a spade.

3DS Friend Code: 1091-7596-4855

mystman12

Is there an easier way to use BGPUT with 2x2 background tiles? In my data, I have to code the tiles like this:

32,33
64,65

That is just for one tile, and it's a little annoying having to figure out all the right numbers for each tile. I was wondering if there was an easier way to place a tile, like just by putting 32 in.

I like makin' games!
Future Pinball games!
Petit Computer games!!
and SmileBASIC games!
Waiting for Kirby Air Ride 2. One day, it will come. One day...

3DS Friend Code: 0259-0292-5888 | Nintendo Network ID: mystman12 | Twitter:

Discostew

ramstrong wrote:

Discostew wrote:

@Gimmemorecoinz

My mistake. I was thinking of INSTR, which was already explained. I was on a 10hr drive, so I wasn't all there.

Wow. 10HR drive. Doesn't sound like a relaxing vacation. I'm a driver so I regularly do 12+ hour drive. It can get tiring sometimes.
BTW, did you analyzed the picture format? I'm thinking that it would be a good way to transfer data from Nintendo DSi to PC. I'm thinking it's raw 8 bit format 256x192. Is that right? Does the image has header files and does it use a compression at all? RLE maybe?

GRP PTC files are made up of a 48 byte header and a 49152 byte data section (which is the 256x192 bitmap). The header is as follows....

4 bytes - "PX01"
4 bytes - Data section size (for GRPs, it is a constant 49152)
4 bytes - PTC file type (always 2)
8 bytes - string - internal name of the GRP as read by Petit Computer
16 bytes - MD5 hash string (based on Data section)
12 bytes - "PETC0100RGRP"

GRP PTC files, excluding the typical 48-byte PTC header, are 256x192 pixels in 8-bit format with no compression, but the way they are stored is not what you think. It doesn't store them in rows of 256 pixels each from left to right as you would expect a bitmap to be stored. Instead, it's a bit closer to how CHR data is stored. The entire image is broken up into 8x8 pixel blocks, but it doesn't end there. There are then 8x8 blocks from left-to-right, top-to-bottom, making up a 64x64 section. Then, the entire image is made up of these sections in a 4x3 manner (to make 256x192 pixels).

The following is in C code, which I use when compiling my game assets into GRP files. I write the data sequentially into "readStream", which is an array of 49152 bytes (256x192), and then read from readStream to "outStream" (same size array) in the manner the GRP format is designated.

for (int j = 0; j < 3; j++)
for (int i = 0; i < 4; i++)
for (int y = 0; y < 8; y++)
for (int x = 0; x < 8; x++)
for (int yy = 0; yy < 8; yy++)
for (int xx = 0; xx < 8; xx++)
outStream[(j * 16384) + (i * 4096) + (y * 512) + (x * 64) + (yy * 8) + xx] = readStream[(j * 16384) + (i * 64) + (y * 2048) + (x * 8) + (yy * 256) + xx];

Edited on by Discostew

Discostew

3DS Friend Code: 4425-1477-0127 | Nintendo Network ID: Discostew

ramstrong

Discostew wrote:

GRP PTC files, excluding the typical 48-byte PTC header, are 256x192 pixels in 8-bit format with no compression, but the way they are stored is not what you think. It doesn't store them in rows of 256 pixels each from left to right as you would expect a bitmap to be stored. Instead, it's a bit closer to how CHR data is stored. The entire image is broken up into 8x8 pixel blocks, but it doesn't end there. There are then 8x8 blocks from left-to-right, top-to-bottom, making up a 64x64 section. Then, the entire image is made up of these sections in a 4x3 manner (to make 256x192 pixels).

Perfect! Thanks for the info. I'm not aware of being able send GRP files directly. I assume then you're using PTC Utilities to convert graphics to QR code.

Petit Computer Journal
Old site http://ramstrong.blogspot.com

Let's just call a spade, a spade.

3DS Friend Code: 1091-7596-4855

Discostew

ramstrong wrote:

Discostew wrote:

GRP PTC files, excluding the typical 48-byte PTC header, are 256x192 pixels in 8-bit format with no compression, but the way they are stored is not what you think. It doesn't store them in rows of 256 pixels each from left to right as you would expect a bitmap to be stored. Instead, it's a bit closer to how CHR data is stored. The entire image is broken up into 8x8 pixel blocks, but it doesn't end there. There are then 8x8 blocks from left-to-right, top-to-bottom, making up a 64x64 section. Then, the entire image is made up of these sections in a 4x3 manner (to make 256x192 pixels).

Perfect! Thanks for the info. I'm not aware of being able send GRP files directly. I assume then you're using PTC Utilities to convert graphics to QR code.

Pretty much, unless I find a faster way to generate the QR codes for both GRPs and PRGs. A PRG has the same header with minor changes, with the Data section holding the code in a non-compressed format. At least with that, it isn't sectioning the data like GRPs do, to my knowledge.

Discostew

3DS Friend Code: 4425-1477-0127 | Nintendo Network ID: Discostew

_dbdbd

I was having issues just like yours also. though there is always the chance were still talking about two different things . I was writing something and I drew up a 64x64 sprite ,saved it SPU0:. had to figure out what number it really put it at . any way it was 0 . got it to work . then i drew up some 32x32 sprites and tried putting them on the same page as the 64x64 one.did the same silly formating thing . I could call I up but it would show up mixed up . I tried everything , keeping the two on the same page , but it would only ever mix em up. well I got to looking and if you look at the pages spu0 0-8 or what ever, i realized they all had the same size sprites. per page or least looked like it . So I got an idea.I kept my 64x64 sprite where it was at; SPU0:SPONGE. saved . opened the editor load it again. went to the SPU page with the 32x32 ,SPU5, drew my sprites saved it as SPU5:VEGIES.
exited. in my program i loaded both the SPU pages just like they were typed in above. it worked . but wait . i turned of my ds . then tried it again and it was displaying the original boy sprite. Long story short. I seperate the sprite sizes and even though when i saved I saved it as the SPU5, I found out that in my program it had to be loaded as SPU1 . I had four vegies drawn in there, locations turned out to be 64,65,66,67. I think it only worked the first time when it was called SPU5 cuz i had originally loaded the CHRED from the cmd prmt then loaded the program with the sprites, with no CLEAR or ACLS so it must have still been in memory.

_dbdbd

TexMurphy

Below should be my petit computer qr code for a 3D square room animation. Its called wall2. You can use the D pad to move in and out and right and left. Maybe someone can make a 3D game. Question: with the room background tiles, how do I make them bigger?
Untitled

TexMurphy

agentep2jb

Hey im new here and till now this had been pretty cool

agentep2jb

Hairmanban19

@Swordx since you can't make the QR codes for Dungeon Adventure could you let me make them for you? But i would only be able to do it today,and tomorrow i would only have a certain amount of time to make them.

Edited on by Hairmanban19

...

3DS Friend Code: 3136-7615-5907

Justlink

hi

Do you like videogames? If so, you must know
It's dangerous to go Alone.

boot

I just charged up my ds... after 3 months. just for the proggramm

Just your average talking boot. FC: 0791-4881-1672 for Smash and Pokemon.

3DS Friend Code: 0791-4881-1672

boot

Is there any way to loo up and down? I also cant seem to turn around after I walk backwords from spawn,can you fix that? And last thing,is there a way to make it go faster? Sorry for all the complaints.

Just your average talking boot. FC: 0791-4881-1672 for Smash and Pokemon.

3DS Friend Code: 0791-4881-1672

Discostew

TexMurphy wrote:

What is the code for collision detection between a sprite character and a background tile in an array? I can detect it only at the origin/home of the sprite and background tile. But, the tile is 8 pixels wide. I can change the home position on the sprite. This would help on a side scroller.

I don't know how you're doing it now, but the way I do it is that my levels are made up of tiles in an array, each element representing a tile value. My sprites have an X/Y position within a level. The collision boundaries are offsets of that position. I take those offsets (relative to the entire level), divide the X/Y values by 16 (I use 16x16 meta tiles, but for 8x8 tiles, divide by 8) to convert it to tile space. Then I use that result and access the array that holds the tile information of the level. I then access another array that holds the attributes of each tile, using the tile value I grabbed from the level array. Each element can hold multiple attributes in bit-form (like 1 = solid block, 2 = ladder, 4 = water, 8 = deadly spike, etc). I then simply examine the tile attributes and how I react to them, like if I'm moving right, and I find the tile I examined is a solid block, then I shift the sprite to the left, making it flush against the tile.

to reduce the amount of examining, only examine the sides that the sprite is moving along. If you're moving to the left, only examine the boundaries on the left side. If you've moving up, only examine the boundaries on the top. The likelihood if needing to examine all opposite sides is very minimal.

Discostew

3DS Friend Code: 4425-1477-0127 | Nintendo Network ID: Discostew

Please login or sign up to reply to this topic