A lot of stuff.

This commit is contained in:
KikooDX 2020-05-21 18:19:04 +02:00
parent e0a33fb714
commit 9c41e416db
7 changed files with 17 additions and 3 deletions

BIN
JTMM.g3a

Binary file not shown.

BIN
assets-cg/img/drill.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 151 B

View File

@ -2,7 +2,9 @@
void draw_anim_speed(int x, int y, image_t *image, int step, int speed);
void draw_anim(int x, int y, image_t *image, int step);
void draw_anim_drill(int x, int y, image_t *image, int step);
void draw_player(int x, int y);
void draw_drill(int x, int y, int direction, int step);
void draw_level(char level[], unsigned int step, char polarity, int *start_x,
int *start_y, int tp_positions[]);
void erase_tile(int x, int y, char level[]);

View File

@ -2,4 +2,4 @@
#define PLAYER_W 11
#define LEVEL_WIDTH 28
#define LAST_LEVEL 5062
#define FPS 60
#define FPS 50

View File

@ -8,6 +8,7 @@
#define DRAW_OFFSET_X -27
extern image_t img_player; //player texture, 12x12 (NOT ANIMATED)
extern image_t img_drill; //drill texture, 12x12 (animated)
extern image_t img_solid_0; //solid texture, 16x16
extern image_t img_solid_1; //solid texture, 16x16
extern image_t img_spike; //spike texture, 16x16
@ -35,11 +36,22 @@ void draw_anim(int x, int y, image_t *image, int step)
draw_anim_speed(x, y, image, step, 1);
}
void draw_anim_drill(int x, int y, image_t *image, int step)
{
dsubimage(x + DRAW_OFFSET_X, y + DRAW_OFFSET_Y, image,
(step % (image->width / 12)) * 12, 0, 12, 12, DIMAGE_NONE);
}
void draw_player(int x, int y)
{
dimage(x + DRAW_OFFSET_X, y + DRAW_OFFSET_Y, &img_player);
}
void draw_drill(int x, int y, int direction, int step)
{
draw_anim_drill(x, y, &img_drill, step);
}
void draw_level(char level[], unsigned int step, char polarity, int *start_x,
int *start_y, int tp_positions[])
{

View File

@ -11,7 +11,7 @@
#include "shared_define.h"
#define MAX_HSPD 2.5
#define DRILL_HSPD 5.0
#define DRILL_HSPD 4.0
#define ACCELERATION 1.0
#define DECELERATION 0.5
#define LOCK_MOMENTUM 5
@ -86,7 +86,7 @@ int main(void)
DRAW_LEVEL();
draw_player(player_x, player_y);
//drill
if (drill_toggle) draw_player(drill_x, drill_y);
if (drill_toggle) draw_drill(drill_x, drill_y, selected_direction, step);
draw_timer(step/2);
dupdate();
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 151 B