Understanding the language, error messages, etc.
by noah » Sun Aug 07, 2016 8:12 am
Hi,
I finally got my Gamebuino
and I have been through the tutorial sketches and built pong etc. The problem is, what now? I have lots of ideas, but I don't know how I could implement them. Are any of the released games documented well? Or are there any good tutorials available for more advanced games?
I'd like to learn about tilemaps, how should I go about that?
Thanks in advance, noah
-
noah
-
- Posts: 25
- Joined: Mon Jul 25, 2016 8:32 am
- Location: Spiffin' Britain
-
by Sorunome » Sun Aug 07, 2016 9:51 am
The basic idea is to iterate over rows and columns and then draw each tile according to the row/coloumn you are at currently. You can see an example for that
here, however that uses one byte for two tiles, thus only allowing 16 different tiles. If you want to have it so that each byte is a tile of its own, you just have to change the getTile function to return pgm_read_byte(world + y*WORLD_W + x);
-
Sorunome
-
- Posts: 629
- Joined: Sun Mar 01, 2015 1:58 pm
-
by noah » Tue Aug 09, 2016 11:04 am
Thanks, I've been looking through the source...
Is there any way I could find that code with the written explanations found in the sample scripts? It's just I don't understand all the reasoning behind all the things that happen.
Thanks again, noah
-
noah
-
- Posts: 25
- Joined: Mon Jul 25, 2016 8:32 am
- Location: Spiffin' Britain
-
by Sorunome » Tue Aug 09, 2016 1:00 pm
I wrote something up over
here, maybe that helps?
-
Sorunome
-
- Posts: 629
- Joined: Sun Mar 01, 2015 1:58 pm
-
by naed » Tue Aug 09, 2016 3:48 pm
Yeah take a look at the post Sorunome linked to, he gave Duhjoker lots of advice on tilemaps and how to implement them
-
naed
-
- Posts: 140
- Joined: Tue May 31, 2016 3:18 pm
by noah » Wed Aug 10, 2016 7:44 pm
Right so I got the tilemap array working but I don't understand how collision detection works. How would I use gb.collideBitmapBitmap, does that work with tilemap arrays? If I had something like gb.collideBitmapBitmap(playerX, playerY, player, xOfWall, yOfWall, wallBitmap); what would I put for the wall for it to cover all the wall tiles, and wall coordinates?
thanks, noah
-
noah
-
- Posts: 25
- Joined: Mon Jul 25, 2016 8:32 am
- Location: Spiffin' Britain
-
by Duhjoker » Thu Aug 11, 2016 2:49 am
With tilemaps you will need to use gb.collide.rectrect you can find plenty of help and examples here......
viewtopic.php?f=8&t=3453
-
Duhjoker
-
- Posts: 446
- Joined: Sat Jul 02, 2016 4:57 am
- Location: Where Palm trees grow
Return to Programming Questions
Who is online
Users browsing this forum: No registered users and 4 guests