Teleporters are now animation, updated elevators
10
src/draw.c
|
@ -20,9 +20,9 @@ extern image_t img_red_dot; //off red bloc texture, 16x16
|
|||
extern image_t img_exit; //exit texture, 16x16
|
||||
extern image_t img_water; //water texture, 16x16
|
||||
extern image_t img_semi_solid; //semi solid texture, 16x16
|
||||
//animated textures (elevator)
|
||||
extern image_t img_teleporter_0; //teleporter 0 texture, 16x16
|
||||
extern image_t img_teleporter_1; //teleporter 1 texture, 16x16
|
||||
//animated textures (elevator)
|
||||
extern image_t img_elevator;
|
||||
|
||||
void draw_player(int x, int y)
|
||||
|
@ -34,6 +34,8 @@ void draw_level(char level[], unsigned int step, char polarity, int *start_x,
|
|||
int *start_y, int tp_positions[])
|
||||
{
|
||||
int const img_elevator_frame_count = img_elevator.width / 16;
|
||||
int const img_teleporter_0_frame_count = img_teleporter_0.width / 16;
|
||||
int const img_teleporter_1_frame_count = img_teleporter_1.width / 16;
|
||||
dclear(BG_COLOR);
|
||||
unsigned int i = 0;
|
||||
unsigned int x = 0;
|
||||
|
@ -85,12 +87,14 @@ int *start_y, int tp_positions[])
|
|||
dimage(x + DRAW_OFFSET_X, y + DRAW_OFFSET_Y, &img_water);
|
||||
break;
|
||||
case 't': //teleporter 0
|
||||
dimage(x + DRAW_OFFSET_X, y + DRAW_OFFSET_Y, &img_teleporter_0);
|
||||
dsubimage(x + DRAW_OFFSET_X, y + DRAW_OFFSET_Y, &img_teleporter_0,
|
||||
(step % img_teleporter_0_frame_count) * 16, 0, 16, 16, DIMAGE_NONE);
|
||||
tp_positions[0] = x + 2;
|
||||
tp_positions[1] = y + 2;
|
||||
break;
|
||||
case 'T': //teleporter 1
|
||||
dimage(x + DRAW_OFFSET_X, y + DRAW_OFFSET_Y, &img_teleporter_1);
|
||||
dsubimage(x + DRAW_OFFSET_X, y + DRAW_OFFSET_Y, &img_teleporter_1,
|
||||
(step % img_teleporter_1_frame_count) * 16, 0, 16, 16, DIMAGE_NONE);
|
||||
tp_positions[2] = x + 2;
|
||||
tp_positions[3] = y + 2;
|
||||
break;
|
||||
|
|
Before Width: | Height: | Size: 214 B After Width: | Height: | Size: 323 B |
Before Width: | Height: | Size: 209 B |
Before Width: | Height: | Size: 214 B |
Before Width: | Height: | Size: 215 B |
Before Width: | Height: | Size: 214 B |
Before Width: | Height: | Size: 224 B |
Before Width: | Height: | Size: 214 B |
Before Width: | Height: | Size: 217 B |
Before Width: | Height: | Size: 215 B |
Before Width: | Height: | Size: 214 B |
Before Width: | Height: | Size: 214 B |
Before Width: | Height: | Size: 214 B |
Before Width: | Height: | Size: 218 B |
Before Width: | Height: | Size: 213 B |
Before Width: | Height: | Size: 217 B |
Before Width: | Height: | Size: 213 B |
Before Width: | Height: | Size: 207 B |
Before Width: | Height: | Size: 134 B After Width: | Height: | Size: 388 B |
Before Width: | Height: | Size: 143 B |
Before Width: | Height: | Size: 150 B |
Before Width: | Height: | Size: 147 B |
Before Width: | Height: | Size: 150 B |
Before Width: | Height: | Size: 148 B |
Before Width: | Height: | Size: 134 B |
Before Width: | Height: | Size: 141 B |
Before Width: | Height: | Size: 141 B |
Before Width: | Height: | Size: 145 B |
Before Width: | Height: | Size: 146 B |
Before Width: | Height: | Size: 149 B |
Before Width: | Height: | Size: 147 B |
Before Width: | Height: | Size: 152 B |
Before Width: | Height: | Size: 153 B |
Before Width: | Height: | Size: 155 B |
Before Width: | Height: | Size: 149 B |