Understanding the language, error messages, etc.
by DrWhoCares » Mon Jan 19, 2015 6:49 am
And it was the Batman of Gamebuino that swooped in and saved the day. It compiled. Testing now.
Well, it could have been a lot worse. When I walk to the right, the two images animate so quickly my dude looks like a little robed guy sliding around. When walking to the left, he looks like a fatter robed guy sliding around.
All in all, not that bad. Expected results seeing as I didn't put in any sort of break between the animation flips.
New question, before I forget, I've seen programs like Crabator, where the image of the map is an 8 by 8 bitmap image, with each tile representing something else. How exactly does that work? How can I create a "World Map" which I can replace 1's with a completely separate Bitmap? (I was unable to figure that out properly from Crabator.
-
DrWhoCares
-
- Posts: 14
- Joined: Fri Sep 05, 2014 6:48 pm
by rodot » Mon Jan 19, 2015 6:58 am
Yeah, Crabator's code is pretty messy, I should clean it up.
You can look at he example "
TileMapRAM" from the Gamebuino Library. It show the principle, but in this example the map is stored in RAM, which is a very scarce resource on the Gamebuino (2KB). To spare RAM, you care store arrays that wont changes (bitmaps, maps...) in the flash memory, aka
PROGMEM (32kB). An example of tile map stored in PROGMEM would be
UFO-Race, which is much cleaner than Crabator.
-
rodot
- Site Admin
-
- Posts: 1290
- Joined: Mon Nov 19, 2012 11:54 pm
- Location: France
-
by DrWhoCares » Mon Jan 19, 2015 7:44 am
I'll have to use UFO race as my goto reference from now on then. Thanks for the tip. Tomorrow i'll take a look at that TileMap code and give it a whirl.
-
DrWhoCares
-
- Posts: 14
- Joined: Fri Sep 05, 2014 6:48 pm
Return to Programming Questions
Who is online
Users browsing this forum: No registered users and 32 guests