Author Topic: Sprite storage, retrieval, and collision detection help  (Read 4167 times)

0 Members and 1 Guest are viewing this topic.

Offline 3_bit

  • LV0 Newcomer (Next: 5)
  • Posts: 4
  • Rating: +0/-0
    • View Profile
Sprite storage, retrieval, and collision detection help
« 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?

Offline Matrefeytontias

  • Axe roxxor (kinda)
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1982
  • Rating: +310/-12
  • Axe roxxor
    • View Profile
    • RMV Pixel Engineers
Re: Sprite storage, retrieval, and collision detection help
« Reply #1 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.

Offline ClrDraw

  • LV7 Elite (Next: 700)
  • *******
  • Posts: 627
  • Rating: +61/-2
    • View Profile
    • GitHub
Re: Sprite storage, retrieval, and collision detection help
« Reply #2 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

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
Visit my GitHub for all my TI programs as well as other projects.
Also check out my website.