refactor: JI_* a Ji:: i JG_* a Jg::
This commit is contained in:
@@ -91,7 +91,7 @@ void Prota::draw() {
|
||||
Sprite::draw();
|
||||
|
||||
if (info::ctx.num_piramide == 4 && this->o != 4) {
|
||||
if ((JG_GetCycleCounter() % 40) < 20) {
|
||||
if ((Jg::getCycleCounter() % 40) < 20) {
|
||||
Jd8::blitCK(this->x, this->y, this->gfx, 220, 80, 15, 15, 255);
|
||||
} else {
|
||||
Jd8::blitCK(this->x, this->y, this->gfx, 235, 80, 15, 15, 255);
|
||||
@@ -104,25 +104,25 @@ auto Prota::update() -> Uint8 {
|
||||
|
||||
if (this->o < 4) {
|
||||
Uint8 dir = 4;
|
||||
if (JI_KeyPressed(SDL_SCANCODE_DOWN)) {
|
||||
if (Ji::keyPressed(SDL_SCANCODE_DOWN)) {
|
||||
if ((this->x - 20) % 65 == 0) {
|
||||
this->o = 0;
|
||||
}
|
||||
dir = this->o;
|
||||
}
|
||||
if (JI_KeyPressed(SDL_SCANCODE_UP)) {
|
||||
if (Ji::keyPressed(SDL_SCANCODE_UP)) {
|
||||
if ((this->x - 20) % 65 == 0) {
|
||||
this->o = 1;
|
||||
}
|
||||
dir = this->o;
|
||||
}
|
||||
if (JI_KeyPressed(SDL_SCANCODE_RIGHT)) {
|
||||
if (Ji::keyPressed(SDL_SCANCODE_RIGHT)) {
|
||||
if ((this->y - 30) % 35 == 0) {
|
||||
this->o = 2;
|
||||
}
|
||||
dir = this->o;
|
||||
}
|
||||
if (JI_KeyPressed(SDL_SCANCODE_LEFT)) {
|
||||
if (Ji::keyPressed(SDL_SCANCODE_LEFT)) {
|
||||
if ((this->y - 30) % 35 == 0) {
|
||||
this->o = 3;
|
||||
}
|
||||
@@ -161,7 +161,7 @@ auto Prota::update() -> Uint8 {
|
||||
if (this->frame_pejades == 15) {
|
||||
this->frame_pejades = 0;
|
||||
}
|
||||
if (JG_GetCycleCounter() % this->cycles_per_frame == 0) {
|
||||
if (Jg::getCycleCounter() % this->cycles_per_frame == 0) {
|
||||
this->cur_frame++;
|
||||
if (this->cur_frame == entitat.animacions[this->o].frames.size()) {
|
||||
this->cur_frame = 0;
|
||||
@@ -170,7 +170,7 @@ auto Prota::update() -> Uint8 {
|
||||
}
|
||||
eixir = 0U;
|
||||
} else {
|
||||
if (JG_GetCycleCounter() % this->cycles_per_frame == 0) {
|
||||
if (Jg::getCycleCounter() % this->cycles_per_frame == 0) {
|
||||
this->cur_frame++;
|
||||
if (this->cur_frame == entitat.animacions[this->o].frames.size()) {
|
||||
if (this->o == 4) {
|
||||
|
||||
Reference in New Issue
Block a user