diff options
author | Simponic <loganthebean222@gmail.com> | 2020-08-08 18:16:34 -0600 |
---|---|---|
committer | Simponic <loganthebean222@gmail.com> | 2020-08-08 18:16:34 -0600 |
commit | 7f856467a086ec9a3ebd1ccdf12e578dffb9c98b (patch) | |
tree | 191714e3ef0daf90d5252532dd0db3f4f0256de5 /source/main.c | |
parent | 6a44a34e0ebb867753df26f1cb0a38f53420a606 (diff) | |
download | geometry-dash-gba-7f856467a086ec9a3ebd1ccdf12e578dffb9c98b.tar.gz geometry-dash-gba-7f856467a086ec9a3ebd1ccdf12e578dffb9c98b.zip |
Player added
Diffstat (limited to 'source/main.c')
-rw-r--r-- | source/main.c | 22 |
1 files changed, 19 insertions, 3 deletions
diff --git a/source/main.c b/source/main.c index a36688d..ae0cf05 100644 --- a/source/main.c +++ b/source/main.c @@ -4,13 +4,18 @@ #include "../include/memmap.h" #include "../include/types.h" #include "../include/memdef.h" + +#include "../include/point.h" +#include "../include/velocity.h" +#include "../include/playerObject.h" #include "../sprites/player.h" OBJ_ATTR obj_buffer[128]; OBJ_AFFINE *obj_aff_buffer= (OBJ_AFFINE*)obj_buffer; // Object affine-buffer void obj_test() { - int x= 96, y= 32; + int x, y; + x = 10; y = 10; u32 tid= 0, pb= 0; OBJ_ATTR *player = &obj_buffer[0]; @@ -38,9 +43,20 @@ int main() { REG_DISPCNT= DCNT_OBJ | DCNT_OBJ_1D; - obj_test(); + playerObject player = createPlayerObject(&obj_buffer[0], 0, 0); + + + while(1) { + vid_vsync(); + key_poll(); + + if ((key_is_down(KEY_A) || key_hit(KEY_A)) && !player.isJumping) { + player.vel.dy -= 9 << FIX_SHIFT; + } - while(1); + updatePlayer(&player, 140); + oam_copy(oam_mem, obj_buffer, 1); + } return 0; } |