{EDIT} change movement speed of enemies and player

This commit is contained in:
SemvdH
2021-08-24 22:36:41 +02:00
parent 066f625831
commit 616e1db466
4 changed files with 6 additions and 2 deletions

View File

@@ -115,7 +115,7 @@ void init_sprites()
// add simple enemies
for (i = 0; i < SIMPLE_ENEMY_MAX_AMOUNT; i++)
{
ENEMY_SPRITE e = {NONACTIVE, SIMPLE, 20 * i + 10, 10, RGBA8(245, 90, 66, 255), 1.0};
ENEMY_SPRITE e = {NONACTIVE, SIMPLE, 0,0, SIMPLE_ENEMY_COLOR, SIMPLE_ENEMY_MOVEMENT_SPEED};
enemies[i] = e;
enemy_count++;
}

View File

@@ -25,6 +25,8 @@
#define PLAYER_Y_OFFSET (PLAYER_HEIGTH / 2) // the center y of the player is in the middle
#define SIMPLE_ENEMY_SIZE 9.0
#define SIMPLE_ENEMY_MOVEMENT_SPEED 1.5
#define SIMPLE_ENEMY_COLOR (RGBA8(245, 90, 66, 255))
#define COMPLEX_ENEMY_SIZE 9.0
#define SMOKE_START_RADIUS 8.0

View File

@@ -20,5 +20,5 @@ void ctrl_input_get_rightstick(SceCtrlData *pad, stick_data *stickdata)
float ctrl_input_calc_value(int16_t pos, SceUInt64 deltaTime)
{
return (float)((pos) * (deltaTime / 1000.0));
return (float)((pos) * (deltaTime / 1000.0)) * PLAYER_SPEED;
}

View File

@@ -4,6 +4,8 @@
#include <stdio.h>
#include <psp2/ctrl.h>
#define PLAYER_SPEED 1.5
/**
* @brief a struct that holds the x and y pos for a stick. < 0 is left or down, > 0 is right or up. Value goes from 0 to 128
*