summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorkdx <kikoodx@paranoici.org>2023-05-05 20:31:45 +0200
committerkdx <kikoodx@paranoici.org>2023-05-05 20:31:45 +0200
commit65368603bd1931662a3f058221783032f1033b4a (patch)
tree5450de4a31fc8b2d0784fc83b6a4733650a57960
parente4f1c916a1389485b6f94013fea83f001bdcca71 (diff)
downloadstudy-sttky-65368603bd1931662a3f058221783032f1033b4a.tar.gz
laaaaaaaaaaaaame
-rw-r--r--map/game.tmj34
-rw-r--r--src/camera.c4
-rw-r--r--src/game.c4
-rw-r--r--src/main.c2
-rw-r--r--src/player.c6
5 files changed, 26 insertions, 24 deletions
diff --git a/map/game.tmj b/map/game.tmj
index 940f24f..655c884 100644
--- a/map/game.tmj
+++ b/map/game.tmj
@@ -3,22 +3,22 @@
"infinite":false,
"layers":[
{
- "data":[2, 0, 0, 1, 1, 0, 1, 0, 0, 0, 0, 2, 0, 0, 0, 0, 2, 0, 1, 0, 0, 0, 0, 1, 1, 0,
- 2, 0, 0, 1, 0, 0, 1, 1, 0, 0, 0, 0, 2, 0, 0, 2, 0, 0, 0, 1, 0, 0, 1, 1, 0, 0,
- 2, 0, 1, 1, 0, 0, 1, 1, 1, 0, 0, 0, 0, 2, 2, 0, 0, 0, 0, 0, 1, 1, 0, 1, 0, 0,
- 2, 0, 1, 0, 0, 0, 1, 0, 1, 1, 0, 0, 2, 2, 0, 2, 0, 0, 1, 1, 1, 1, 1, 1, 0, 0,
- 1, 1, 1, 0, 0, 0, 1, 0, 0, 1, 1, 2, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 1, 0, 0, 0,
- 1, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 1, 0, 0, 1, 1, 1, 2, 0, 0, 0, 0, 0, 1, 0, 0,
- 2, 0, 1, 0, 0, 0, 1, 0, 0, 2, 0, 1, 1, 1, 1, 0, 0, 0, 2, 0, 0, 0, 0, 0, 1, 0,
- 2, 0, 1, 0, 0, 0, 1, 2,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
"width":5,
- "x":103.5,
+ "x":18,
"y":94.5
}],
"opacity":1,
diff --git a/src/camera.c b/src/camera.c
index 5cca51b..c58d8c6 100644
--- a/src/camera.c
+++ b/src/camera.c
@@ -14,8 +14,8 @@ int flip_offset_y;
void
camera_init(void)
{
- cam[0] = 0.0;
- cam[1] = 0.0;
+ cam[0] = clamp(DWIDTH/2.0, map_width() * TSIZE - DWIDTH/2.0, 0);
+ cam[1] = clamp(DHEIGHT/2.0, map_height() * TSIZE - DHEIGHT/2.0, 0);
}
void
diff --git a/src/game.c b/src/game.c
index 1a8a246..f32cb0c 100644
--- a/src/game.c
+++ b/src/game.c
@@ -26,11 +26,7 @@ game_update(Game *this)
this->queue_previous_scene = 0;
this->checkpoint = false;
map_next();
- this->missed_bois +=
- game_entity_count(this, entity_type("boi"));
game_restart_scene(this);
- this->total_bois +=
- game_entity_count(this, entity_type("boi"));
return;
}
}
diff --git a/src/main.c b/src/main.c
index ac508c5..0cf5124 100644
--- a/src/main.c
+++ b/src/main.c
@@ -83,7 +83,9 @@ main_loop(void *udata)
if (TZR_DrawBegin())
return 1;
+ pxPalt();
pxCls(0);
+ pxPalt(0, true);
game_draw(game);
acid();
pxFlip();
diff --git a/src/player.c b/src/player.c
index cdf42c7..a4d346e 100644
--- a/src/player.c
+++ b/src/player.c
@@ -3,6 +3,7 @@
IMPL_INIT(player, 0) {
IMPL_UNUSED;
this->height = this->width = 5;
+ this->pos[1] -= 1;
}
IMPL(update) {
@@ -23,8 +24,11 @@ IMPL(update) {
else
this->vel[1] += 0.1;
+ if (this->pos[0] > PX_WIDTH) {
+ g->queue_next_scene = 1;
+ printf("YO\n");
+ }
move();
- camera_update(this->vel);
}
IMPL(draw) {