add SpriteInstruction class
This commit is contained in:
@@ -90,6 +90,64 @@ SpriteAction& SpriteAction::SetNextAction(const std::string& nextActionName) {
|
|||||||
|
|
||||||
std::string SpriteAction::GetConfiguration() const { return ""; }
|
std::string SpriteAction::GetConfiguration() const { return ""; }
|
||||||
|
|
||||||
|
// ============================================================================
|
||||||
|
|
||||||
|
SpriteInstruction SpriteInstruction::PlayAnimation(int startFrame, int endFrame,
|
||||||
|
int speed) {
|
||||||
|
SpriteInstruction instruction;
|
||||||
|
|
||||||
|
return instruction;
|
||||||
|
}
|
||||||
|
|
||||||
|
SpriteInstruction SpriteInstruction::ApplySpeedTowardsPlayer(int speed) {
|
||||||
|
SpriteInstruction instruction;
|
||||||
|
instruction.SetConfiguration("JSL Sprite_ApplySpeedTowardsPlayer");
|
||||||
|
return instruction;
|
||||||
|
}
|
||||||
|
|
||||||
|
SpriteInstruction SpriteInstruction::CheckDamageFromPlayer() {
|
||||||
|
SpriteInstruction instruction;
|
||||||
|
|
||||||
|
return instruction;
|
||||||
|
}
|
||||||
|
|
||||||
|
SpriteInstruction SpriteInstruction::MoveXyz() {
|
||||||
|
SpriteInstruction instruction;
|
||||||
|
|
||||||
|
return instruction;
|
||||||
|
}
|
||||||
|
|
||||||
|
SpriteInstruction SpriteInstruction::BounceFromTileCollision() {
|
||||||
|
SpriteInstruction instruction;
|
||||||
|
|
||||||
|
return instruction;
|
||||||
|
}
|
||||||
|
|
||||||
|
SpriteInstruction SpriteInstruction::SetTimer(int timerId, int value) {
|
||||||
|
SpriteInstruction instruction;
|
||||||
|
|
||||||
|
return instruction;
|
||||||
|
}
|
||||||
|
|
||||||
|
SpriteInstruction SpriteInstruction::Custom(const std::string& asmCode) {
|
||||||
|
SpriteInstruction instruction;
|
||||||
|
|
||||||
|
return instruction;
|
||||||
|
}
|
||||||
|
|
||||||
|
SpriteInstruction SpriteInstruction::BehaveAsBarrier() {
|
||||||
|
SpriteInstruction instruction;
|
||||||
|
|
||||||
|
return instruction;
|
||||||
|
}
|
||||||
|
|
||||||
|
SpriteInstruction SpriteInstruction::JumpToFunction(
|
||||||
|
const std::string& functionName) {
|
||||||
|
SpriteInstruction instruction;
|
||||||
|
|
||||||
|
return instruction;
|
||||||
|
}
|
||||||
|
|
||||||
} // namespace zelda3
|
} // namespace zelda3
|
||||||
} // namespace app
|
} // namespace app
|
||||||
} // namespace yaze
|
} // namespace yaze
|
||||||
|
|||||||
@@ -8,6 +8,31 @@ namespace yaze {
|
|||||||
namespace app {
|
namespace app {
|
||||||
namespace zelda3 {
|
namespace zelda3 {
|
||||||
|
|
||||||
|
class SpriteInstruction {
|
||||||
|
public:
|
||||||
|
// Predefined instructions
|
||||||
|
static SpriteInstruction PlayAnimation(int startFrame, int endFrame,
|
||||||
|
int speed);
|
||||||
|
static SpriteInstruction ApplySpeedTowardsPlayer(int speed);
|
||||||
|
static SpriteInstruction CheckDamageFromPlayer();
|
||||||
|
static SpriteInstruction MoveXyz();
|
||||||
|
static SpriteInstruction BounceFromTileCollision();
|
||||||
|
static SpriteInstruction SetTimer(int timerId, int value);
|
||||||
|
static SpriteInstruction BehaveAsBarrier();
|
||||||
|
static SpriteInstruction JumpToFunction(const std::string& functionName);
|
||||||
|
|
||||||
|
// Custom instruction
|
||||||
|
static SpriteInstruction Custom(const std::string& asmCode);
|
||||||
|
|
||||||
|
// Get the instruction configuration
|
||||||
|
std::string GetConfiguration() const { return instruction_; }
|
||||||
|
void SetConfiguration(const std::string& instruction) {
|
||||||
|
instruction_ = instruction;
|
||||||
|
}
|
||||||
|
|
||||||
|
private:
|
||||||
|
std::string instruction_;
|
||||||
|
};
|
||||||
|
|
||||||
class SpriteAction {
|
class SpriteAction {
|
||||||
public:
|
public:
|
||||||
|
|||||||
Reference in New Issue
Block a user