Skip to content
This repository has been archived by the owner on May 7, 2021. It is now read-only.

Commit

Permalink
début de fade out
Browse files Browse the repository at this point in the history
  • Loading branch information
noliv committed Jan 27, 2013
1 parent 3f090a3 commit 60a8329
Show file tree
Hide file tree
Showing 5 changed files with 40 additions and 3 deletions.
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
version = "1.0">
<FileBreakpoints>
<FileBreakpoint
shouldBeEnabled = "Yes"
shouldBeEnabled = "No"
ignoreCount = "0"
continueAfterRunningActions = "No"
filePath = "GGJ13/WHGameLayer.mm"
Expand Down Expand Up @@ -42,5 +42,18 @@
landmarkName = "-playBGMWithIntro:andLoop:"
landmarkType = "5">
</FileBreakpoint>
<FileBreakpoint
shouldBeEnabled = "Yes"
ignoreCount = "0"
continueAfterRunningActions = "No"
filePath = "GGJ13/WHGameLayer.mm"
timestampString = "380980287.756497"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "303"
endingLineNumber = "303"
landmarkName = "-itemTapped:"
landmarkType = "5">
</FileBreakpoint>
</FileBreakpoints>
</Bucket>
21 changes: 19 additions & 2 deletions GGJ13/GGJ13/WHGameLayer.mm
Original file line number Diff line number Diff line change
Expand Up @@ -300,22 +300,25 @@ -(void)initRecording {

-(void)itemTapped:(WHItem *)item {
NSLog(@"HIT! Appliquer effet %d",[item effect]);
BOOL itemSent = NO;

if (_lastActionSuccess) {
_jaugeSucces++;
} else {
_jaugeSucces = 0;
_jaugeSucces = 1;
_jaugeEchecs = 0;
_lastActionSuccess = YES;
}

int jaugeStatut=0;
if (_jaugeSucces > 0 && _jaugeSucces < 3) {
if (_jaugeSucces >= 0 && _jaugeSucces < 3) {
jaugeStatut = 1;
} else if (_jaugeSucces < 6) {
jaugeStatut = 2;
}else {
if (_shouldSendDrugToOpponent && item.type != ItemTypeNormal) {
[self.gameScene sendDrug:item.type];
itemSent = YES;
jaugeStatut = 0;
_jaugeSucces = 0;
_shouldSendDrugToOpponent = NO;
Expand All @@ -327,6 +330,20 @@ -(void)itemTapped:(WHItem *)item {

[self.gameScene updateJaugeWith:jaugeStatut];



if(item.type != ItemTypeNormal && !itemSent) {
// il faut appliquer l’item à notre propre face
[self.gameScene incrementBPM:[item effect]];

if (item.type == ItemTypeGHB) {
[self.gameScene displayMessage:3];
NSLog(@" todo effet ghb : score à zéro");
} else if (item.type == ItemTypeLSD) {
[self.gameScene displayMessage:2];
}
}

[self.activeItems removeObject:item];
[self removeChild:item cleanup:YES];
if (item.specialPeer != nil) {
Expand Down
2 changes: 2 additions & 0 deletions GGJ13/GGJ13/WHGameScene.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@
-(int) getGameBPM;
-(void) updateJaugeWith:(int)statut;
-(void) sendDrug:(int)itemType;
-(void) displayMessage:(int)m;


+(WHGameScene *) scene:(int)m;

Expand Down
5 changes: 5 additions & 0 deletions GGJ13/GGJ13/WHGameScene.mm
Original file line number Diff line number Diff line change
Expand Up @@ -414,6 +414,11 @@ -(void) displayMessage:(int)m {

bgpic.position = ccp(winsize.width/2 , winsize.height/2 );
[headerLayer addChild:bgpic z:1 tag:13];

// Create fade out action
//id actionFadeOut = [CCFadeIn actionWithDuration:1.0f];
//[bgpic runAction:[CCSequence actions:[CCMoveBy actionWithDuration:1.0f position:ccp(0,0)], actionFadeOut, nil]];

BBAudioManager *audioManager = [BBAudioManager sharedAM];
[audioManager playSFX:son];
[self scheduleOnce:@selector(removeMessage:) delay:2.0];
Expand Down

0 comments on commit 60a8329

Please sign in to comment.