Formatting was weird
This commit is contained in:
parent
62450d92ab
commit
852b2c41eb
@ -29,12 +29,12 @@ int main() {
|
|||||||
|
|
||||||
REG_DISPCNT= DCNT_OBJ | DCNT_OBJ_1D;
|
REG_DISPCNT= DCNT_OBJ | DCNT_OBJ_1D;
|
||||||
|
|
||||||
playerObject player = createPlayerObject(&obj_buffer[0], &obj_aff_buffer[0],0, 0);
|
playerObject player = createPlayerObject(&obj_buffer[0], &obj_aff_buffer[0],0, 0);
|
||||||
player.camera = createCamera(-10, 0);
|
player.camera = createCamera(-10, 0);
|
||||||
int currentXLevel = 0;
|
int currentXLevel = 0;
|
||||||
int playing = 1;
|
int playing = 1;
|
||||||
while(playing) {
|
while(playing) {
|
||||||
vid_vsync();
|
vid_vsync();
|
||||||
if (key_is_down(KEY_START) || currentXLevel >= 39) {
|
if (key_is_down(KEY_START) || currentXLevel >= 39) {
|
||||||
oam_init(obj_buffer, 128);
|
oam_init(obj_buffer, 128);
|
||||||
currentXLevel = 0;
|
currentXLevel = 0;
|
||||||
@ -43,20 +43,20 @@ int main() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
player.camera.x += 2;
|
player.camera.x += 2;
|
||||||
key_poll();
|
key_poll();
|
||||||
|
|
||||||
if ((player.camera.x + 10)% 16 == 0) {
|
if ((player.camera.x + 10)% 16 == 0) {
|
||||||
currentXLevel++;
|
currentXLevel++;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((key_is_down(KEY_A) || key_hit(KEY_A)) && !player.isJumping) {
|
if ((key_is_down(KEY_A) || key_hit(KEY_A)) && !player.isJumping) {
|
||||||
player.vel.dy -= 9 << FIX_SHIFT;
|
player.vel.dy -= 9 << FIX_SHIFT;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//updatePlayer(&player, 80);
|
//updatePlayer(&player, 80);
|
||||||
obj_affine_copy(obj_aff_mem, player.affine, 1);
|
obj_affine_copy(obj_aff_mem, player.affine, 1);
|
||||||
obj_copy(obj_mem, player.obj, 1);
|
obj_copy(obj_mem, player.obj, 1);
|
||||||
|
|
||||||
OBJ_ATTR blockObject, spikeObject;
|
OBJ_ATTR blockObject, spikeObject;
|
||||||
obj_set_attr(&blockObject,
|
obj_set_attr(&blockObject,
|
||||||
@ -80,9 +80,9 @@ int main() {
|
|||||||
if (x + 16 > 0 && x <= 240 && (currentXLevel) < 40){
|
if (x + 16 > 0 && x <= 240 && (currentXLevel) < 40){
|
||||||
if (map1[i][j] == 1) {
|
if (map1[i][j] == 1) {
|
||||||
currentMemoryLocation++;
|
currentMemoryLocation++;
|
||||||
if (j == currentXLevel) {
|
if (j == currentXLevel) {
|
||||||
updatePlayer(&player, 16 * i - 16);
|
updatePlayer(&player, 16 * i - 16);
|
||||||
}
|
}
|
||||||
obj_set_pos(&blockObject, x, y);
|
obj_set_pos(&blockObject, x, y);
|
||||||
obj_copy(obj_mem + currentMemoryLocation, &blockObject, 1);
|
obj_copy(obj_mem + currentMemoryLocation, &blockObject, 1);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user