Omnimaga

Calculator Community => Major Community Projects => The Axe Parser Project => Topic started by: 3_bit on December 28, 2013, 09:33:28 pm

Title: Sprite storage, retrieval, and collision detection help
Post by: 3_bit on December 28, 2013, 09:33:28 pm
So I've written a few basic games in TI-Basic and have moved to the far more efficient Axe Parser. I understand the general structure of most commands and want to begin work on a more advanced game. With my older projects I used characters as sprites and simple X-Y check against maps for collision detection. But this was slow and tedious to program, and would need to be entirely rewritten for each map.

What I'm looking for is a way to easily recall sprites from a picture (seeing as how it is efficient as I could hypothetically store 96 8x8 sprites in an image). These will be simple monochrome sprites, with 2 additional images to support them: one with a pixel to denote the center of each sprite (and thus the origin of it's rendering) and another for a collision mesh. I'm completely new to working with images, but I understand how hexadecimal works, and am willing to learn. What I guess I really need is some example code with reasoning as to why and how it works, and some help in the future with optimizing my own code. Are there any Axioms that might help with this kind of thing?
Title: Re: Sprite storage, retrieval, and collision detection help
Post by: Matrefeytontias on December 29, 2013, 04:26:47 am
You can look to the various tilemapping tutorials in the "Tutorials" section of the site. Things are usually explained well.
Title: Re: Sprite storage, retrieval, and collision detection help
Post by: ClrDraw on December 29, 2013, 12:48:26 pm
IDK about an axiom for that, but there are many tutorials. I used this tutorial to learn maps and it has worked very well.
http://www.omnimaga.org/index.php?action=articles;sa=view;article=85 (http://www.omnimaga.org/index.php?action=articles;sa=view;article=85)

If you're curious what kind of programs you can make using maps, this is what I'm working on now. It is based off of the example program at the end of the tutorial.
http://ourl.ca/20349/371276 (http://ourl.ca/20349/371276)