Author Topic: Question  (Read 4132 times)

0 Members and 1 Guest are viewing this topic.

Offline Raylin

  • Godslayer
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1392
  • Rating: +83/-25
  • I am a certifiable squirrel ninja.
    • View Profile
    • Ray M. Perry
Question
« on: April 18, 2011, 05:27:56 pm »
How do you distinguish between different tiles on the ground in Axe, based on pixel-by-pixel collision?
Bug me about my book.

Sarah: TI-83 Plus Silver Edition [OS 1.19]
Cassie: TI-86 [OS 1.XX]
Elizabeth: TI-81 [OS 1.XX]
Jehuty: TI-83 Plus Silver Edition [OS 1.19]
Tesla: CASIO Prizm







Offline DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55943
  • Rating: +3154/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • Dream of Omnimaga Music
Re: Question
« Reply #1 on: April 18, 2011, 05:40:08 pm »
By pixel-by-pixel, I assume you mean the pixel-test() command?

Sadly the only way I know of is to store a copy of your map in the back buffer, where every solid tile are plain black (or has a black mask corresponding to every solid part of the tile) and the rest is white, then pixel-test from there, kinda like what I did in Super Sonic Ball. It has been 8 or 9 months since I touched Axe, though.
« Last Edit: April 18, 2011, 05:40:28 pm by DJ_O »

Offline Quigibo

  • The Executioner
  • CoT Emeritus
  • LV11 Super Veteran (Next: 3000)
  • *
  • Posts: 2031
  • Rating: +1075/-24
  • I wish real life had a "Save" and "Load" button...
    • View Profile
Re: Question
« Reply #2 on: April 19, 2011, 12:41:03 am »
If you're using a tilemap, you should definitely not be using pixel by pixel collision detection.  Since you already have the tilemap data, its much easier to just write a quick tile detection routine that gets the current tile at a given (x,y) on the map.
___Axe_Parser___
Today the calculator, tomorrow the world!

Offline Raylin

  • Godslayer
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1392
  • Rating: +83/-25
  • I am a certifiable squirrel ninja.
    • View Profile
    • Ray M. Perry
Re: Question
« Reply #3 on: April 21, 2011, 05:03:29 pm »
Can you elaborate on that?

How do you NOT use pixel by pixel detection in Axe?
Isn't that how smooth collisions and stuff work?
Bug me about my book.

Sarah: TI-83 Plus Silver Edition [OS 1.19]
Cassie: TI-86 [OS 1.XX]
Elizabeth: TI-81 [OS 1.XX]
Jehuty: TI-83 Plus Silver Edition [OS 1.19]
Tesla: CASIO Prizm







Offline Builderboy

  • Physics Guru
  • CoT Emeritus
  • LV13 Extreme Addict (Next: 9001)
  • *
  • Posts: 5673
  • Rating: +613/-9
  • Would you kindly?
    • View Profile
Re: Question
« Reply #4 on: April 21, 2011, 11:55:12 pm »
I think Quigibo thought you meant collision via pixel testing.  Maybe you wanna check out a post I made a bit ago about the subject of per pixel collisions with both square tiles and masked tiles.

http://ourl.ca/4279/169823

Offline leafy

  • CoT Emeritus
  • LV10 31337 u53r (Next: 2000)
  • *
  • Posts: 1554
  • Rating: +475/-97
  • Seizon senryakuuuu!
    • View Profile
    • keff.me
Re: Question
« Reply #5 on: April 22, 2011, 01:56:06 am »
There are ways of accessing which tile the player is in through pointers. I still use Builder's method except I never figured out masked tiles >.<
In-progress: Graviter (...)