This commit is contained in:
t. boddy 2026-02-14 20:36:23 -05:00
parent 0b905f2690
commit e8ed3e0faf
6 changed files with 25 additions and 52 deletions

View file

@ -1,8 +1,6 @@
#define PLAYER_SPEED FIX32(5)
#define PLAYER_SPEED_NORM fix32Mul(PLAYER_SPEED, FIX32(0.707))
#define PLAYER_SPEED_FOCUS FIX32(3)
#define PLAYER_SPEED_FOCUS_NORM fix32Mul(PLAYER_SPEED_FOCUS, FIX32(0.707))
#define PLAYER_ACCEL PLAYER_SPEED >> 3
#define PLAYER_ACCEL_FOCUS PLAYER_SPEED_FOCUS >> 3
@ -19,7 +17,7 @@
s16 shotClock;
fix32 screenX;
fix32 playerSpeed, playerSpeedNorm;
fix32 playerSpeed;
fix32 playerVelX; // Track actual X velocity for momentum
static void movePlayer(){
@ -31,12 +29,9 @@ static void movePlayer(){
if(ctrl.left || ctrl.right || ctrl.up || ctrl.down){
if(ctrl.b){
playerSpeed = PLAYER_SPEED_FOCUS;
playerSpeedNorm = PLAYER_SPEED_FOCUS_NORM;
} else {
playerSpeed = PLAYER_SPEED;
playerSpeedNorm = PLAYER_SPEED_NORM;
}
player.last.x = player.pos.x;
if(ctrl.left || ctrl.right){
if(!ctrl.a) player.shotAngle = ctrl.left ? 512 : 0;
targetVelX = ctrl.left ? -playerSpeed : playerSpeed;
@ -116,10 +111,7 @@ static void shootPlayer(){
.angle = player.shotAngle,
.player = TRUE
};
void updater(u8 i){
if(bullets[i].clock >= 16) killBullet(i);
}
spawnBullet(spawner, updater);
spawnBullet(spawner, EMPTY);
shotClock = SHOT_INTERVAL;
} else if(shotClock > 0) shotClock--;
}