-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(FireParticle): Implement Fire particle behavior
- Add `FireParticleBehavior` - fix some behavior processing. fix #84
- Loading branch information
Showing
5 changed files
with
72 additions
and
10 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
30 changes: 30 additions & 0 deletions
30
src/main/java/fr/snapgames/fromclasstogame/core/behaviors/particle/FireParticleBehavior.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 fr.snapgames.fromclasstogame.core.behaviors.particle; | ||
|
||
import fr.snapgames.fromclasstogame.core.behaviors.Behavior; | ||
import fr.snapgames.fromclasstogame.core.entity.particles.Particle; | ||
import fr.snapgames.fromclasstogame.core.gfx.Render; | ||
import fr.snapgames.fromclasstogame.core.io.ActionHandler; | ||
|
||
public class FireParticleBehavior implements Behavior<Particle> { | ||
|
||
@Override | ||
public void onInput(Particle go, ActionHandler ih) { | ||
|
||
} | ||
|
||
@Override | ||
public void onUpdate(Particle go, long dt) { | ||
go.velocity = go.acceleration.multiply(dt).multiply(0.5); | ||
go.position = go.velocity.multiply(dt); | ||
} | ||
|
||
@Override | ||
public void onRender(Particle go, Render r) { | ||
|
||
} | ||
|
||
@Override | ||
public void onAction(Particle go, ActionHandler.ACTIONS action) { | ||
|
||
} | ||
} |
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