Reduced spike hitboxes (Lephenixnoir suggestion) and created a Massena-difficulty level

This commit is contained in:
KikooDX 2020-03-21 16:31:53 +01:00
parent ef220b48e5
commit f95a2ec8b7
7 changed files with 15 additions and 4 deletions

BIN
JTMM.g3a

Binary file not shown.

View File

@ -1,4 +1,5 @@
char collide(int x, int y, char level[], char tile);
char collide_spike(int x, int y, char level[]);
char collide_solid(int x, int y, char level[], char polarity);
char collide_point(int x, int y, char level[], char tile);
char collide_and_erase(int x, int y, char level[], char tile);

View File

@ -4,6 +4,7 @@
#define PLAYER_H 11
#define PLAYER_W 11
#define LEVEL_WIDTH 28
#define SPIKE_SCAM 2
char collide(int x, int y, char level[], char tile)
{
@ -15,6 +16,14 @@ char collide(int x, int y, char level[], char tile)
return 0;
}
char collide_spike(int x, int y, char level[])
{
return (collide_point(x + SPIKE_SCAM, y + SPIKE_SCAM, level, 'v') ||
collide_point(x + PLAYER_W - SPIKE_SCAM, y + SPIKE_SCAM, level, 'v') ||
collide_point(x + SPIKE_SCAM, y + PLAYER_H - SPIKE_SCAM, level, 'v') ||
collide_point(x + PLAYER_W - SPIKE_SCAM, y + PLAYER_H - SPIKE_SCAM, level, 'v'));
}
char collide_point(int x, int y, char level[], char tile)
{
return (level[(int)(x/16) + (int)(y/16) * LEVEL_WIDTH] == tile);

File diff suppressed because one or more lines are too long

View File

@ -196,7 +196,7 @@ int main(void)
}
}
//spike collision and death
if (collide(player_x, player_y, level, 'v'))
if (collide_spike(player_x, player_y, level))
{
player_x = start_x;
player_y = start_y;
@ -214,7 +214,7 @@ int main(void)
if (collide(player_x, player_y, level, 'E'))
{
level_id++;
if (level_id == 5059)
if (level_id == 5060)
{
just_breathe(step);
return 0;

View File

@ -2,7 +2,7 @@
#include <gint/keyboard.h>
#include "menu.h"
#define LAST_LEVEL 5058
#define LAST_LEVEL 5059
#define Y_POS 88

View File

@ -0,0 +1 @@
000000000000000000000000000000000vvvvvv0000000000000000000vv....vv^...v000000000...0v......v^v...000000000...0v..v...v^..^.000000000.S.0vww0v..v^..^.0E.000000rrr0vvww0..v^..^.0..000000.v000vwS0.vv^.v^.0v.000000.vv00vv0v.vv^..^..w.000000..v0vvww0..v^..^....000000...0vwrwv..v^..^....000000...0wwwvv..v^v.^w...000000vr..wwvvv.wr...^vvvv0000000vv00000vvv0v0v00000000000000000000000000000000000