- [NEW] Módul "info"retocat
This commit is contained in:
7
bola.cpp
7
bola.cpp
@@ -2,8 +2,7 @@
|
||||
#include "jgame.h"
|
||||
#include <stdlib.h>
|
||||
|
||||
Bola::Bola( JD8_Surface gfx, Info* info, Prota* sam ) : Sprite( gfx ) {
|
||||
this->info = info;
|
||||
Bola::Bola( JD8_Surface gfx, Prota* sam ) : Sprite( gfx ) {
|
||||
this->sam = sam;
|
||||
|
||||
this->entitat = (Entitat*)malloc( sizeof( Entitat ) );
|
||||
@@ -58,8 +57,8 @@ void Bola::update() {
|
||||
// Comprovem si ha tocat a Sam
|
||||
if( this->x > ( this->sam->x - 7 ) && this->x < ( this->sam->x + 7 ) && this->y > ( this->sam->y - 7 ) && this->y < ( this->sam->y + 7 ) ) {
|
||||
this->contador = 200;
|
||||
this->info->vida--;
|
||||
if( this->info->vida == 0 ) this->sam->o = 5;
|
||||
info::vida--;
|
||||
if( info::vida == 0 ) this->sam->o = 5;
|
||||
}
|
||||
} else {
|
||||
this->contador--;
|
||||
|
||||
Reference in New Issue
Block a user