mirror of
https://github.com/TerryCavanagh/VVVVVV.git
synced 2026-01-30 01:48:15 +03:00
Add a player trail to the editor (ghosts)
A few months ago, I added ghosts to the VVVVVV: Community Edition editor. I was told recently I should think about upstreaming it, and with Terry saying go ahead I finally ported them into VVVVVV. There's one slight difference however--you can choose whether you have them or not in the editor's settings menu. They're off by default, and this is saved to the save file. Anyway, when you're playtesting, the game saves the players position, color, room coordinates and sprite every 3 frames. The max is 100, where if it tries to add more, the oldest one gets removed. When you exit playtesting, the saved positions appear one at a time, and you can use the Z key to speed it up. [Here's a video of them in action.](https://o.lol-sa.me/4H21zCv.mp4)
This commit is contained in:
@@ -75,6 +75,14 @@ private:
|
||||
|
||||
};
|
||||
|
||||
struct GhostInfo {
|
||||
int rx; // game.roomx-100
|
||||
int ry; // game.roomy-100
|
||||
int x; // .xp
|
||||
int y; // .yp
|
||||
int col; // .colour
|
||||
int frame; // .drawframe
|
||||
};
|
||||
|
||||
class editorclass{
|
||||
//Special class to handle ALL editor variables locally
|
||||
@@ -228,6 +236,9 @@ class editorclass{
|
||||
int dmtileeditor;
|
||||
|
||||
int returneditoralpha;
|
||||
|
||||
std::vector<GhostInfo> ghosts;
|
||||
int currentghosts = 0;
|
||||
};
|
||||
|
||||
void addedentity(int xp, int yp, int tp, int p1=0, int p2=0, int p3=0, int p4=0, int p5=320, int p6=240);
|
||||
|
||||
Reference in New Issue
Block a user