she movin

This commit is contained in:
t. boddy 2022-08-15 20:50:22 -04:00
parent ed762d838f
commit bceaab2878
9 changed files with 128 additions and 41 deletions

View File

@ -1,32 +1,57 @@
########## #########
# THEMES # # THEME #
########## #########
-
- 100 (overheat)
- connect/transfer (???)
############ ############
# GAMEPLAY # # GAMEPLAY #
############ ############
- The player controls a ship which automatically flies forward through scrolling levels.
- It has a limited amount of fuel that constantly depletes. - scrolling shmup either horizontal, isometric-ish, vertical depending on zone
- Fuel is replenished by destroying enemies - nitori will overheat if she doesn't kill (like fuel in vanguard)
- bomb
- single straight shot
########## ##########
# LEVELS # # LEVELS #
########## ##########
- Tunnel 1
- Mountain Zone - level 1
- Rainbow Zone - hori
- Styx Zone - iso up
- Rainbow Zone 2 - hori
- Stripe Zone - iso down
- Rainbow Zone 3 - hori
- Bleak Zone - iso up
- Last Zone - tate
- Tunnel 2 - boss
- Mountain Zone - level 2
- Stripe Zone - hori
- Styx Zone - hori
- Rainbow Zone - hori
- Bleak Zone - iso up
- Last Zone - tate
- At the end of each tunnel the player must defeat a boss guarded by two moving force fields with holes in them. - boss
- hopefully about 8 minutes by here. now we start looping with suicide bullets
- win screen or kill screen at lvl 255? !??!?!!!?!
###############
# ASSET NEEDS #
###############
- tate sprite for nitori....
- think connect/transfer
- bigger shot and robot sprite?
- 2 songs min needed
- start
- stage
- extra songs ordered by priority
- boss 1
- boss 2
- stage 2
- game over screen

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.9 KiB

After

Width:  |  Height:  |  Size: 5.4 KiB

BIN
res/player/nitori.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.1 KiB

BIN
res/player/reimu.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.2 KiB

View File

@ -9,4 +9,4 @@ IMAGE frame1 "chrome/frame1.png" FAST
IMAGE frame2 "chrome/frame2.png" FAST IMAGE frame2 "chrome/frame2.png" FAST
IMAGE frame3 "chrome/frame3.png" FAST IMAGE frame3 "chrome/frame3.png" FAST
SPRITE reimu "player/player.png" 4 4 FAST 0 SPRITE nitori "player/nitori.png" 4 4 FAST

View File

@ -21,18 +21,20 @@ static void drawBg(){
// update // update
#define BG_SPEED_X -FIX16(0.2)
#define BG_SPEED_Y FIX16(0.1) #define BG_SPEED FIX16(1)
#define BG_SPEED_NORM FIX16(0.707)
#define BG_SIZE_F FIX16(BG_SIZE) #define BG_SIZE_F FIX16(BG_SIZE)
Vect2D_f16 bgPos; Vect2D_f16 bgPos;
static void scrollBg(){ static void scrollBg(){
VDP_setHorizontalScroll(BG_B, fix16ToInt(bgPos.x)); VDP_setHorizontalScroll(BG_B, fix16ToInt(bgPos.x));
VDP_setVerticalScroll(BG_B, fix16ToInt(bgPos.y)); VDP_setVerticalScroll(BG_B, fix16ToInt(bgPos.y));
bgPos.x = fix16Add(bgPos.x, BG_SPEED_X); bgPos.x = fix16Sub(bgPos.x, BG_SPEED);
bgPos.y = fix16Add(bgPos.y, BG_SPEED_Y); // bgPos.y = fix16Add(bgPos.y, BG_SPEED_NORM);
if(bgPos.x <= -BG_SIZE_F) bgPos.x = 0; if(bgPos.x <= -BG_SIZE_F) bgPos.x = fix16Add(bgPos.x, BG_SIZE_F);
if(bgPos.y >= BG_SIZE_F) bgPos.y = 0; if(bgPos.y >= BG_SIZE_F) bgPos.y = fix16Sub(bgPos.y, BG_SIZE_F);
} }
@ -43,5 +45,5 @@ void loadBg(){
} }
void updateBg(){ void updateBg(){
// scrollBg(); scrollBg();
} }

View File

@ -26,13 +26,15 @@ static void loadInternals(){
static void loadGame(){ static void loadGame(){
loadBg(); loadBg();
loadTiles(); loadTiles();
loadPlayer();
loadChrome(); loadChrome();
} }
static void updateGame(){ static void updateGame(){
updateTiles();
updatePlayer();
updateBg(); updateBg();
updateChrome(); updateChrome();
updateTiles();
clock++; clock++;
if(clock >= CLOCK_LIMIT) clock -= CLOCK_LIMIT; if(clock >= CLOCK_LIMIT) clock -= CLOCK_LIMIT;
} }

View File

@ -1,12 +1,13 @@
// player // player
#define PLAYER_OFF FIX16(16) #define PLAYER_OFF FIX16(16)
#define PLAYER_INIT_X FIX16(32) #define PLAYER_INIT_X FIX16(40)
#define PLAYER_INIT_Y FIX16(32) #define PLAYER_INIT_Y FIX16(GAME_H / 2)
struct playerStruct { struct playerStruct {
Vect2D_f16 pos; Vect2D_f16 pos, vel;
Sprite* image; Sprite* image;
s16 clock;
}; };
struct playerStruct player; struct playerStruct player;
@ -14,19 +15,76 @@ struct playerStruct player;
// spawn // spawn
static void spawnPlayer(){ static void spawnPlayer(){
player.pos.x = 0; player.pos.x = PLAYER_INIT_X;
player.pos.y = 0; player.pos.y = PLAYER_INIT_Y;
player.image = SPR_addSprite(&reimu, player.image = SPR_addSprite(&nitori,
fix16ToInt(fix16Sub(player.pos.x, PLAYER_OFF)), fix16ToInt(fix16Sub(player.pos.x, PLAYER_OFF)),
fix16ToInt(fix16Sub(player.pos.y, PLAYER_OFF)), fix16ToInt(fix16Sub(player.pos.y, PLAYER_OFF)),
TILE_ATTR(PAL1, 0, 0, 0)); TILE_ATTR(PAL1, 0, 0, 0));
} }
// collision
#define PLAYER_LIMIT_X FIX16(16)
#define PLAYER_LIMIT_W FIX16(GAME_W - 16)
#define PLAYER_LIMIT_Y FIX16(16)
#define PLAYER_LIMIT_H FIX16(GAME_H - 16)
static void checkPlayerBounds(){
if(player.pos.x < PLAYER_LIMIT_X) player.pos.x = PLAYER_LIMIT_X;
else if(player.pos.x > PLAYER_LIMIT_W) player.pos.x = PLAYER_LIMIT_W;
if(player.pos.y < PLAYER_LIMIT_Y) player.pos.y = PLAYER_LIMIT_Y;
else if(player.pos.y > PLAYER_LIMIT_H) player.pos.y = PLAYER_LIMIT_H;
}
// movement
#define PLAYER_SPEED FIX16(2)
#define PLAYER_SPEED_NORM FIX16(2 * 0.707)
s16 playerFrame;
static void movePlayer(){
playerFrame = 0;
if(ctrl.left || ctrl.right || ctrl.up || ctrl.down){
if(ctrl.left || ctrl.right){
if(ctrl.up || ctrl.down){
player.vel.x = ctrl.left ? -PLAYER_SPEED_NORM : PLAYER_SPEED_NORM;
player.vel.y = ctrl.up ? -PLAYER_SPEED_NORM : PLAYER_SPEED_NORM;
playerFrame = ctrl.up ? 2 : 1;
} else {
player.vel.x = ctrl.left ? -PLAYER_SPEED : PLAYER_SPEED;
player.vel.y = 0;
}
} else if(ctrl.up){
player.vel.x = 0;
player.vel.y = -PLAYER_SPEED;
playerFrame = 2;
} else if(ctrl.down){
player.vel.x = 0;
player.vel.y = PLAYER_SPEED;
playerFrame = 1;
}
if(player.vel.x != 0) player.pos.x = fix16Add(player.pos.x, player.vel.x);
if(player.vel.y != 0) player.pos.y = fix16Add(player.pos.y, player.vel.y);
checkPlayerBounds();
}
SPR_setFrame(player.image, playerFrame);
}
// loop // loop
void loadPlayer(){} void loadPlayer(){
spawnPlayer();
}
void updatePlayer(){ void updatePlayer(){
spawnPlayer(); movePlayer();
SPR_setPosition(player.image,
fix16ToInt(fix16Sub(player.pos.x, PLAYER_OFF)),
fix16ToInt(fix16Sub(player.pos.y, PLAYER_OFF)));
player.clock++;
if(player.clock >= CLOCK_LIMIT) player.clock -= CLOCK_LIMIT;
} }