she movin
This commit is contained in:
parent
ed762d838f
commit
bceaab2878
73
bible.txt
73
bible.txt
|
@ -1,32 +1,57 @@
|
|||
##########
|
||||
# THEMES #
|
||||
##########
|
||||
-
|
||||
#########
|
||||
# THEME #
|
||||
#########
|
||||
|
||||
- 100 (overheat)
|
||||
- connect/transfer (???)
|
||||
|
||||
|
||||
############
|
||||
# GAMEPLAY #
|
||||
############
|
||||
- The player controls a ship which automatically flies forward through scrolling levels.
|
||||
- It has a limited amount of fuel that constantly depletes.
|
||||
- Fuel is replenished by destroying enemies
|
||||
|
||||
- scrolling shmup either horizontal, isometric-ish, vertical depending on zone
|
||||
- nitori will overheat if she doesn't kill (like fuel in vanguard)
|
||||
- bomb
|
||||
- single straight shot
|
||||
|
||||
|
||||
##########
|
||||
# LEVELS #
|
||||
##########
|
||||
- Tunnel 1
|
||||
- Mountain Zone
|
||||
- Rainbow Zone
|
||||
- Styx Zone
|
||||
- Rainbow Zone 2
|
||||
- Stripe Zone
|
||||
- Rainbow Zone 3
|
||||
- Bleak Zone
|
||||
- Last Zone
|
||||
- Tunnel 2
|
||||
- Mountain Zone
|
||||
- Stripe Zone
|
||||
- Styx Zone
|
||||
- Rainbow Zone
|
||||
- Bleak Zone
|
||||
- Last Zone
|
||||
- At the end of each tunnel the player must defeat a boss guarded by two moving force fields with holes in them.
|
||||
|
||||
- level 1
|
||||
- hori
|
||||
- iso up
|
||||
- hori
|
||||
- iso down
|
||||
- hori
|
||||
- iso up
|
||||
- tate
|
||||
- boss
|
||||
- level 2
|
||||
- hori
|
||||
- hori
|
||||
- hori
|
||||
- iso up
|
||||
- tate
|
||||
- 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
|
BIN
res/bg/1_1.png
BIN
res/bg/1_1.png
Binary file not shown.
Before Width: | Height: | Size: 4.9 KiB After Width: | Height: | Size: 5.4 KiB |
Binary file not shown.
After Width: | Height: | Size: 4.4 KiB |
Binary file not shown.
Before Width: | Height: | Size: 2.1 KiB |
Binary file not shown.
After Width: | Height: | Size: 5.2 KiB |
|
@ -9,4 +9,4 @@ IMAGE frame1 "chrome/frame1.png" FAST
|
|||
IMAGE frame2 "chrome/frame2.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
|
|
@ -21,18 +21,20 @@ static void drawBg(){
|
|||
|
||||
// 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)
|
||||
Vect2D_f16 bgPos;
|
||||
|
||||
static void scrollBg(){
|
||||
VDP_setHorizontalScroll(BG_B, fix16ToInt(bgPos.x));
|
||||
VDP_setVerticalScroll(BG_B, fix16ToInt(bgPos.y));
|
||||
bgPos.x = fix16Add(bgPos.x, BG_SPEED_X);
|
||||
bgPos.y = fix16Add(bgPos.y, BG_SPEED_Y);
|
||||
if(bgPos.x <= -BG_SIZE_F) bgPos.x = 0;
|
||||
if(bgPos.y >= BG_SIZE_F) bgPos.y = 0;
|
||||
bgPos.x = fix16Sub(bgPos.x, BG_SPEED);
|
||||
// bgPos.y = fix16Add(bgPos.y, BG_SPEED_NORM);
|
||||
if(bgPos.x <= -BG_SIZE_F) bgPos.x = fix16Add(bgPos.x, BG_SIZE_F);
|
||||
if(bgPos.y >= BG_SIZE_F) bgPos.y = fix16Sub(bgPos.y, BG_SIZE_F);
|
||||
}
|
||||
|
||||
|
||||
|
@ -43,5 +45,5 @@ void loadBg(){
|
|||
}
|
||||
|
||||
void updateBg(){
|
||||
// scrollBg();
|
||||
scrollBg();
|
||||
}
|
|
@ -26,13 +26,15 @@ static void loadInternals(){
|
|||
static void loadGame(){
|
||||
loadBg();
|
||||
loadTiles();
|
||||
loadPlayer();
|
||||
loadChrome();
|
||||
}
|
||||
|
||||
static void updateGame(){
|
||||
updateTiles();
|
||||
updatePlayer();
|
||||
updateBg();
|
||||
updateChrome();
|
||||
updateTiles();
|
||||
clock++;
|
||||
if(clock >= CLOCK_LIMIT) clock -= CLOCK_LIMIT;
|
||||
}
|
||||
|
|
76
src/player.h
76
src/player.h
|
@ -1,12 +1,13 @@
|
|||
// player
|
||||
|
||||
#define PLAYER_OFF FIX16(16)
|
||||
#define PLAYER_INIT_X FIX16(32)
|
||||
#define PLAYER_INIT_Y FIX16(32)
|
||||
#define PLAYER_INIT_X FIX16(40)
|
||||
#define PLAYER_INIT_Y FIX16(GAME_H / 2)
|
||||
|
||||
struct playerStruct {
|
||||
Vect2D_f16 pos;
|
||||
Vect2D_f16 pos, vel;
|
||||
Sprite* image;
|
||||
s16 clock;
|
||||
};
|
||||
struct playerStruct player;
|
||||
|
||||
|
@ -14,19 +15,76 @@ struct playerStruct player;
|
|||
// spawn
|
||||
|
||||
static void spawnPlayer(){
|
||||
player.pos.x = 0;
|
||||
player.pos.y = 0;
|
||||
player.image = SPR_addSprite(&reimu,
|
||||
player.pos.x = PLAYER_INIT_X;
|
||||
player.pos.y = PLAYER_INIT_Y;
|
||||
player.image = SPR_addSprite(&nitori,
|
||||
fix16ToInt(fix16Sub(player.pos.x, PLAYER_OFF)),
|
||||
fix16ToInt(fix16Sub(player.pos.y, PLAYER_OFF)),
|
||||
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
|
||||
|
||||
void loadPlayer(){}
|
||||
|
||||
void updatePlayer(){
|
||||
void loadPlayer(){
|
||||
spawnPlayer();
|
||||
}
|
||||
|
||||
void updatePlayer(){
|
||||
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;
|
||||
}
|
Reference in New Issue