Map works!

This commit is contained in:
2024-02-26 20:19:22 -08:00
parent 055b3dd7b1
commit 9ef88fb34d
4 changed files with 43 additions and 0 deletions

View File

@ -1,5 +1,6 @@
#include "art/game_demo_sprites.h"
#include "device/device.h"
#include "map/game_map.h"
#include "game.h"
#include "sys/sys.h"
@ -13,6 +14,7 @@ int32_t ellipse_x1 = 96 * 4;
int32_t ellipse_y1 = 96 * 4;
int32_t ellipse_dx1 = 3;
int32_t ellipse_dy1 = 4;
int32_t map_x = 0;
const char* game_title() {
@ -47,6 +49,9 @@ void game_destroy() {
void game_update() {
game_frame += 4;
map_x += 1;
map_x %= 160;
ellipse_x0 += ellipse_dx0;
if (ellipse_x0 < 0 || ellipse_x0 > DEVICE_W * 4) { ellipse_dx0 *= -1; }
ellipse_y0 += ellipse_dy0;
@ -101,4 +106,6 @@ void game_draw() {
16, 8,
false, false
);
sys_map_draw(game_map, game_demo_sprites, 0, 0, map_x, 8, 32, 18);
}

View File

@ -1,5 +1,11 @@
#ifndef CROCPARTY_GAME_MAP_H
#define CROCPARTY_GAME_MAP_H
#include "sys/sys.h"
extern sys_i32 game_map_player_start_x;
extern sys_i32 game_map_player_start_y;
extern sys_map game_map;
#endif