Save. Progress. Done.
This commit is contained in:
parent
02857917f9
commit
ff3c1ffe01
|
@ -7,7 +7,7 @@ io.write("void set_level(int level_id, char level[]){")
|
|||
io.write("switch (level_id){")
|
||||
current = 0
|
||||
for i = 0, 9999, 1 do
|
||||
file = io.open("../up-editor/screens/"..i..".scr")
|
||||
file = io.open("up-editor/screens/"..i..".scr")
|
||||
file_content = nil
|
||||
if file then
|
||||
file_content = file:read()
|
||||
|
|
BIN
platform.g3a
BIN
platform.g3a
Binary file not shown.
File diff suppressed because one or more lines are too long
12
src/main.c
12
src/main.c
|
@ -42,6 +42,7 @@ int main(void)
|
|||
int move = 0;
|
||||
int direction = 0;
|
||||
int on_ground = 6; //remember if player is on solid
|
||||
char in_water = 0;
|
||||
int player_x = 0;
|
||||
int player_y = 0;
|
||||
int start_x = 18*16 + 2;
|
||||
|
@ -131,13 +132,15 @@ int main(void)
|
|||
}
|
||||
else
|
||||
{
|
||||
if (on_ground != 6 && vspd < MAX_VSPD) vspd += GRAV;
|
||||
if (on_ground != 6 && vspd < MAX_VSPD) vspd += GRAV / (1 + in_water);
|
||||
if (on_ground) on_ground--;
|
||||
}
|
||||
//in water?
|
||||
in_water = collide(player_x, player_y, level, 'w');
|
||||
//vertical movement
|
||||
jump_test(&jump_pressed, &jump_buffer, &jump_hold);
|
||||
//jump
|
||||
if (jump_buffer && (on_ground || collide(player_x, player_y, level, 'w'))) {
|
||||
if (jump_buffer && (on_ground || in_water)) {
|
||||
vspd = JUMP_SPD;
|
||||
on_ground = 0;
|
||||
jump_hold = JUMP_SCALE;
|
||||
|
@ -160,7 +163,9 @@ int main(void)
|
|||
}
|
||||
//vertical collision
|
||||
{
|
||||
int trunc_vspd = vspd; //truncate vspd
|
||||
int trunc_vspd;
|
||||
if (in_water) trunc_vspd = vspd / 2;
|
||||
else trunc_vspd = vspd;
|
||||
//bouncer
|
||||
if (collide(player_x, player_y + trunc_vspd, level, '*'))
|
||||
{
|
||||
|
@ -206,6 +211,7 @@ int main(void)
|
|||
level_id++;
|
||||
set_level(level_id, level);
|
||||
DRAW_LEVEL();
|
||||
dprint(100, 0, C_WHITE, C_BLACK, "%d", level_id);
|
||||
player_x = start_x;
|
||||
player_y = start_y;
|
||||
polarity = 0;
|
||||
|
|
|
@ -0,0 +1 @@
|
|||
0000000000ww0000000www0000000000000www0000000www000000.....0..000000000www000000.S...0.^000000000www000000000..0.^00000........00000000..0.^0000.........00000.....0.^000vbww0rrrrr00000.....0.^00rwwbw0.....00000bb0vvv.^0vwrwwv0.....00000wwrww..0wbwwrw00v.vvv00000wwrww..0wwbwv000.....00000wwrww..0rwwb0000.....00000vvvww..0wrv000000.E.00000000000**0ww0000000...00000000000000ww0000000...0000
|
|
@ -11,6 +11,6 @@ tiles = {
|
|||
love.graphics.newImage(img_path.."spawn.png"),
|
||||
love.graphics.newImage(img_path.."exit.png"),
|
||||
}
|
||||
tiles_char = { '0', 'r', 'b', 'v', '^', 'w', '*', 'S', 'e'}
|
||||
tiles_char = { '0', 'r', 'b', 'v', '^', 'w', '*', 'S', 'E'}
|
||||
|
||||
selected_tile = 1
|
||||
|
|
Loading…
Reference in New Issue