Understanding the language, error messages, etc.
by Duhjoker » Sun Jul 17, 2016 11:04 pm
Uhhggg!!! Just got ecoding all the sprites to a sprite sheet excluding the Bosses. I also gave gave the ghinis,gibdos and stalphos an extra sprite by making a left and right. That should gove them that back and forth motion they have.
So the sheet with out bosses is only 24K but that is still a lot.
What does the tracker program do that comes with all the software.
-
Duhjoker
-
- Posts: 446
- Joined: Sat Jul 02, 2016 4:57 am
- Location: Where Palm trees grow
by Duhjoker » Mon Jul 18, 2016 2:40 am
0k im looking at the TileMapRAM example and im at "getSpriteID". ive noticed some games assign a number the sprites, which would be better.
how exactly do add the output of the tilemap generator or would it be better to assign the sprite a byte number and use those to make a byte array?
this what I have so far......
- Code: Select all
#include<SPI.h>
#include<Gamebuino.h>
Gamebuino gb;
//store the different sprites in PROGMEM
const byte rock_terrain_master[] PROGMEM = {16,16,0x1f,0x3C,0xE,0xF,0xe,0xF,0x8E,0xC7,0x8C,0x47,0xC,0x1,0xC,0x1F,0xC,0x23,0x5C,0x21,0xDC,0x21,0xBE,0x63,0xBF,0x63,0x60,0xE3,0x40,0xE7,0xD3,0xFF,];
const byte rock_terrain_mountaintop[] PROGMEM = {16,16,0xCF,0xFF,0x87,0xEF,0x3,0xC7,0x83,0x83,0x83,0x83,0x87,0x87,0x83,0x86,0x3,0x8E,0x1,0xE,0x1,0x6,0x3,0x3,0x83,0x2,0x83,0x83,0x3,0x3,0x86,0x7,0xB2,0x3,};
const byte rock_terrain_valley_NE[] PROGMEM = {16,16,0x10,0xFB,0x10,0x31,0x30,0x31,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x38,0x70,0x3c,0xF4,0x3C,0xFE,0x7C,0xFF,0xfC,0xFF,0xFC,0xFF,0xFC,0xFF,0xFC,0xFF,0xFF,};
const byte rock_terrain_valley_NW[] PROGMEM = {16,16,0x81,0xE7,0x80,0xE3,0x80,0xE3,0xB0,0xE3,0xC8,0xE3,0x88,0xEF,0x88,0xFF,0x88,0xFF,0x89,0xFF,0xC9,0xFF,0xC9,0xFF,0xCB,0xFF,0xDF,0xFF,0xFF,0xFF,0xFF,OxFF,};
const byte rock_terrain_valley_SE[] PROGMEM = {16,16,0xFF,0xFF,0x3F,0xFF,0x3F,0xFF,0x3F,0xFF,0x3F,0xFF,0x3E,0x7F,0x3C,0x2F,0x3C,0xE,0x1C,0xC,0xC,0xC,0xC,0xC,0xC,0xC,0xC,0xC,0xBC,0xC,0xBC,0X8,0xDF,0x8,};
const byte rock_terrain_valley_SW[] PROGMEM = {16,16,0xFF,0xFF,0xFF,0xFF,0xFF,0xFB,0xFF,0xD3,0xFF,0x93,0xFF,0x93,0xFF,0x91,0xFF,0x91,0xFF,0x11,0xFF,0x11,0xF7,0x11,0xC7,0x13,0xC7,0xD,0xC7,0x1,0xC7,0x1,0xE7,0x81,};
const byte port_master[] PROGMEM = {16,16,0xFF,0xFF,0xFF,0xFF,0xFF,0XFF,0xFF,0xFF,0xFF,0XFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,};
#define NUM_SPRITES 7
const byte sprites[NUM_SPRITES] ={
rock_terrain_master, rock_terrain_mountaintop, rock_terrainvalley_NE,rock_terrain_valley_NW, rock_terrain_valley_SE, rock_terrain_valley_SW, port_master,
};
#define WORLD_W 16
#define WORLD_H 11
byte world[WORLD_W][WORLD_H];
void setup() {
// put your setup code here, to run once:
}
void loop() {
// put your main code here, to run repeatedly:
}
-
Duhjoker
-
- Posts: 446
- Joined: Sat Jul 02, 2016 4:57 am
- Location: Where Palm trees grow
by Sorunome » Mon Jul 18, 2016 7:51 am
The tracker thing is to create sound patterns, more on that in the wiki
-
Sorunome
-
- Posts: 629
- Joined: Sun Mar 01, 2015 1:58 pm
-
by Duhjoker » Mon Jul 18, 2016 8:29 am
Ok I think I might have my first question tell me if this right.
When I do the numsprites command after using the progmem function to the sprites the order of the sprites gives them their number with the first one being 0.
Then when I draw my bit map I use 0x plus the two letters which correspond the number from above?
So if the first two blocks on the screen are Rock_terrain_master and its number is 0 I would use 0x00,
-
Duhjoker
-
- Posts: 446
- Joined: Sat Jul 02, 2016 4:57 am
- Location: Where Palm trees grow
by Sorunome » Mon Jul 18, 2016 8:35 am
Sorry, I am confused at what you are trying to ask. The 0x in front of a number only says that it's in hexadecimal form
-
Sorunome
-
- Posts: 629
- Joined: Sun Mar 01, 2015 1:58 pm
-
by Duhjoker » Mon Jul 18, 2016 8:51 am
Sorry had to look back. Ok on this file i was told to look at called world.ino, the numsprites command has all the sprites in a list with a comment //0 next thr first sprite and a 1 with the next sorite down.
Then below that is what looks like an array hexidecimals using the number of two sprite as the last two digits of the hex code.
https://github.com/Rodot/UFO-Race/blob/ ... /world.inoThis persons world is 32 by 32 so theres 16 hex codes per line and 16 lines.
-
Duhjoker
-
- Posts: 446
- Joined: Sat Jul 02, 2016 4:57 am
- Location: Where Palm trees grow
by Duhjoker » Mon Jul 18, 2016 8:55 am
Do i have to use the hexidecimal form or can i use what the tilemap generator prints put? It would save space to use the generator
-
Duhjoker
-
- Posts: 446
- Joined: Sat Jul 02, 2016 4:57 am
- Location: Where Palm trees grow
by Sorunome » Mon Jul 18, 2016 9:09 am
You can use any number notation you like, the below are all equivalent
- Code: Select all
10 // decimal
0x0A // hexadecimal
0b00001010 // binary
-
Sorunome
-
- Posts: 629
- Joined: Sun Mar 01, 2015 1:58 pm
-
by Duhjoker » Tue Jul 19, 2016 7:19 am
Ok I'm looking at the code generated by the tile map encoder. It has to areas.....tilemap and spritesheet.
After using the progmem function I have define number_sprites set up....
If I want to use the tilemap generator do I still use
- Code: Select all
num_sprite
or
- Code: Select all
const byte spriteshhet[] = { rock_terrain, etc
Or do i use both?
Also do I still use
- Code: Select all
#define world_w and _H
if I'm using
- Code: Select all
const byte tilemap[] progmem = {16,11, etc
-
Duhjoker
-
- Posts: 446
- Joined: Sat Jul 02, 2016 4:57 am
- Location: Where Palm trees grow
by Sorunome » Tue Jul 19, 2016 7:49 am
Depending on how you write the tilemapper and the sprites you can skip the sprite sheet, I's recommend taking look at the examples on that linked in here.
-
Sorunome
-
- Posts: 629
- Joined: Sun Mar 01, 2015 1:58 pm
-
Return to Programming Questions
Who is online
Users browsing this forum: No registered users and 2 guests