void drawshape(float x, float y, unsigned int c)
{
- Tile* ptile = TileManager::instance()->get
- (c);
- if(ptile)
+ if (c != 0)
{
- if(ptile->images.size() > 1)
+ Tile* ptile = TileManager::instance()->get(c);
+ if(ptile)
{
- texture_draw(&ptile->images[( ((global_frame_counter*25) / ptile->anim_speed) % (ptile->images.size()))],x,y);
- }
- else
- {
- texture_draw(&ptile->images[0],x,y);
+ if(ptile->images.size() > 1)
+ {
+ texture_draw(&ptile->images[( ((global_frame_counter*25) / ptile->anim_speed) % (ptile->images.size()))],x,y);
+ }
+ else
+ {
+ texture_draw(&ptile->images[0],x,y);
+ }
}
}
extern st_level current_level;
/* Function prototypes: */
+class Tile;
+Tile* gettile(float x, float y);
int gameloop(const char * subset, int levelnb, int mode);
void savegame(int slot);
void loadgame(int slot);
reader.read_string("background", &plevel->bkgd_image);
reader.read_string("particle_system", &plevel->particle_system);
reader.read_int_vector("background-tm", &bg_tm);
- reader.read_int_vector("interactive-tm", &ia_tm);
+
+ if (!reader.read_int_vector("interactive-tm", &ia_tm))
+ reader.read_int_vector("tilemap", &ia_tm);
+
reader.read_int_vector("dynamic-tm", &dn_tm);
reader.read_int_vector("foreground-tm", &fg_tm);
/* Change the size of a level (width) */
void level_change_size (st_level* plevel, int new_width)
{
- int y;
-
if(new_width < 21)
new_width = 21;
tilemap_change_size((unsigned int***)&plevel->ia_tiles,new_width,plevel->width);
#include "player.h"
#include "defines.h"
#include "scene.h"
+#include "tile.h"
#include "screen.h"
texture_type tux_life;
if(size == SMALL)
{
/* Get a distro from a brick? */
- if (shape(base.x, base.y) == 'x' ||
- shape(base.x, base.y) == 'y')
+ if (gettile(base.x, base.y)->brick ||
+ gettile(base.x, base.y)->brick)
{
add_bouncy_distro((((int)base.x)
/ 32) * 32,
score = score + SCORE_DISTRO;
distros++;
}
- else if (shape(base.x+ 31, base.y) == 'x' ||
- shape(base.x+ 31, base.y) == 'y')
+ else if (gettile(base.x+ 31, base.y)->brick ||
+ gettile(base.x+ 31, base.y)->brick)
{
add_bouncy_distro((((int)base.x + 31)
/ 32) * 32,
std::vector<std::string> filenames;
Tile* tile = new Tile;
- tile->solid = false;
- tile->brick = false;
- tile->ice = false;
+ tile->solid = false;
+ tile->brick = false;
+ tile->ice = false;
tile->fullbox = false;
- tile->alpha = 0;
- tile->distro = 0;
- tile->data = 0;
+ tile->distro = false;
+ tile->data = 0;
+ tile->alpha = 0;
tile->anim_speed = 25;
LispReader reader(lisp_cdr(element));