- /* CO_BADGUY & CO_PLAYER check */
- for(i = 0; i < bad_guys.size(); ++i)
- {
- if(bad_guys[i].dying == DYING_NOT && rectcollision_offset(&bad_guys[i].base,&tux.base,0,0))
- {
- /* We have detected a collision and now call the collision functions of the collided objects. */
- if (tux.previous_base.y < tux.base.y &&
- tux.previous_base.y + tux.previous_base.height < bad_guys[i].base.y + bad_guys[i].base.height/2 &&
- bad_guys[i].kind != BAD_MONEY && bad_guys[i].mode != HELD)
- {
- bad_guys[i].collision(&tux, CO_PLAYER);
- }
- else
- {
- tux.collision(&bad_guys[i], CO_BADGUY);
- }
- }
- }
+bool isspike(float x, float y)
+{
+ const Tile* tile = gettile(x,y);
+ return tile && (tile->attributes & Tile::SPIKE);
+}