Added lots of parameters to Entity and Character so it woul be easier to handle actions during gameplay.

This commit is contained in:
no
2021-06-07 15:55:04 +02:00
parent 9ea45e793a
commit 67d4c9be53
12 changed files with 239 additions and 52 deletions

View File

@ -1,10 +1,13 @@
package gameplay.actions;
import gameplay.frames.*;
import gameplay.input.ButtonIG;
import java.util.ArrayList;
public interface Action {
ArrayList<Frame> getFrame();
abstract ButtonIG[][] getCommand();
}

View File

@ -16,7 +16,7 @@ public class Attack implements Action {
* For example, a classic fireball would be something like
* {{DOWN},{DOWN,RIGHT},{RIGHT},{A}}
*/
private static Button[][] command;
private static ButtonIG[][] command;
/**
@ -42,4 +42,29 @@ public class Attack implements Action {
}
return res;
}
public static boolean isIsSpecial() {
return isSpecial;
}
public static void setIsSpecial(boolean isSpecial) {
Attack.isSpecial = isSpecial;
}
@Override
public ButtonIG[][] getCommand() {
return command;
}
public static void setCommand(ButtonIG[][] command) {
Attack.command = command;
}
public attackPart[] getParts() {
return parts;
}
public void setParts(attackPart[] parts) {
this.parts = parts;
}
}

View File

@ -3,15 +3,15 @@ package gameplay.actions;
import java.util.ArrayList;
import gameplay.frames.Frame;
import gameplay.input.Button;
import gameplay.input.ButtonIG;
public class Dash implements Action {
/**
* The suite of Inputs to have the move come out.
* For example, a Front Dash would be something like
* {{RIGHT},{RIGHT}}
* {{FORWARD},{FORWARD}}
*/
private static Button[][] command;
private static ButtonIG[][] command;
private Frame[] frames;
@ -25,4 +25,9 @@ public class Dash implements Action {
return res;
}
@Override
public ButtonIG[][] getCommand() {
return command;
}
}

View File

@ -3,16 +3,16 @@ package gameplay.actions;
import java.util.ArrayList;
import gameplay.frames.Frame;
import gameplay.input.Button;
import gameplay.input.ButtonIG;
public class Jump implements Action {
/**
* The Input to have the move come out.
* For example, a Front Jump would be something like
* {UP,RIGHT}
* {{UP,RIGHT}}
*/
private static Button[] command;
private static ButtonIG[][] command;
private Frame[] frames;
@ -25,4 +25,9 @@ public class Jump implements Action {
return res;
}
@Override
public ButtonIG[][] getCommand() {
return command;
}
}

View File

@ -3,7 +3,7 @@ package gameplay.actions;
import java.util.ArrayList;
import gameplay.frames.Frame;
import gameplay.input.Button;
import gameplay.input.ButtonIG;
public class Throw implements Action {
@ -17,7 +17,7 @@ public class Throw implements Action {
* For example, a Moonsault Press would be something like
* {{LEFT},{DOWN,LEFT},{DOWN},{DOWN,RIGHT},{RIGHT},{RIGHT,UP},{UP},{A}}
*/
private static Button[][] command;
private static ButtonIG[][] command;
/**
* The different sections of the throw
@ -50,4 +50,9 @@ public class Throw implements Action {
return res;
}
@Override
public ButtonIG[][] getCommand() {
return command;
}
}