mirror of
https://github.com/jokerx3/HeatUp
synced 2026-07-27 09:59:45 +02:00
PowerUpController Klasse hinzugefügt
This commit is contained in:
@@ -0,0 +1,35 @@
|
|||||||
|
package de.heatup.objects;
|
||||||
|
|
||||||
|
import de.heatup.cfg.Config;
|
||||||
|
import de.heatup.ui.Main;
|
||||||
|
import de.heatup.ui.PanelBuilder;
|
||||||
|
|
||||||
|
public class PowerUpController {
|
||||||
|
|
||||||
|
/*
|
||||||
|
* isPlayer true -> PowerUp wird für spieler verwendet
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
public void activate(int powerup, boolean isPlayer) {
|
||||||
|
if (isPlayer) {
|
||||||
|
if ( powerup == 1 ) {
|
||||||
|
PanelBuilder.getInstancedObjects().getObjects().get(0).setSpeedMultiplicator(4);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public void deactivate(int powerup, boolean isPlayer) {
|
||||||
|
if (isPlayer) {
|
||||||
|
if ( powerup == 1 ) {
|
||||||
|
PanelBuilder.getInstancedObjects().getObjects().get(0).setSpeedMultiplicator(Config.initialSpeedMultiplicator);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getDuration(int powerup) {
|
||||||
|
if ( powerup == 1 ) {
|
||||||
|
return 10;
|
||||||
|
}
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user