-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixed merge conflicts for release v0.2.0
- Loading branch information
Showing
27 changed files
with
822 additions
and
150 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
30 changes: 30 additions & 0 deletions
30
duelinvaders/src/main/java/org/enstabretagne/Component/LifeComponent.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
package org.enstabretagne.Component; | ||
|
||
import org.enstabretagne.Core.Constant; | ||
|
||
import com.almasb.fxgl.entity.component.Component; | ||
|
||
/** | ||
* Cette classe représente l'affichage du nombre de vies restantes. | ||
* | ||
* @author MathieuDFS, jufch | ||
* @since 0.2.0 | ||
*/ | ||
public class LifeComponent extends Component { | ||
/** | ||
* Initialise le composant affichage de vie | ||
*/ | ||
public void initialize(Constant.Direction direction) { | ||
if (direction == Constant.Direction.UP) { | ||
entity.setX(Constant.GAME_WIDTH - Constant.LIFE_DISPLAY_WIDTH); | ||
entity.setY(0); | ||
} else if (direction == Constant.Direction.DOWN) { | ||
entity.setX(Constant.GAME_WIDTH - Constant.LIFE_DISPLAY_WIDTH); | ||
entity.setY(Constant.GAME_HEIGHT - Constant.LIFE_DISPLAY_HEIGHT); | ||
} | ||
} | ||
|
||
public void updateLife(boolean isActive) { | ||
entity.getViewComponent().setOpacity(isActive ? 1 : 0); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
33 changes: 33 additions & 0 deletions
33
duelinvaders/src/main/java/org/enstabretagne/Component/ShootingSmokeComponent.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
package org.enstabretagne.Component; | ||
|
||
import static org.enstabretagne.Core.Constant.SMOKE_DURATION; | ||
|
||
import org.enstabretagne.Core.Constant; | ||
|
||
import com.almasb.fxgl.dsl.components.ExpireCleanComponent; | ||
import com.almasb.fxgl.entity.component.Component; | ||
|
||
/** | ||
* Cette classe représente la fumée lors d'un tir. | ||
* | ||
* @author MathieuDFS, jufch | ||
* @since 0.2.0 | ||
*/ | ||
public class ShootingSmokeComponent extends Component { | ||
/** | ||
* Initialise le composant fumée | ||
* Cette méthode ajoute le composant ExpireCleanComponent | ||
* | ||
* @param direction | ||
*/ | ||
public void initialize(Constant.Direction direction) { | ||
this.entity.addComponent(new ExpireCleanComponent(SMOKE_DURATION)); | ||
double dx = Constant.SHOOTING_SMOKE_WIDTH / 2; | ||
double dy = 30; | ||
if (direction == Constant.Direction.DOWN) { | ||
this.entity.rotateBy(180); | ||
this.entity.translate(dx, dy); | ||
} | ||
this.entity.translate(-dx, -dy); | ||
} | ||
} |
Oops, something went wrong.