Record the player and create a clone who repeat action

This forum is currently in read-only mode.
From the Asset Store
Background Story generation templates. See the Arcade demo.
  • Hello,

    I need to do a record/play function like these flash games :

    In my case, it is for a platform game. I want record the player's action, restart the level and play the recorded action on many clones exactly like in theses flash.

    Is this possible ? how can I do that ?


  • You have to record any x and y position and store them(in an array or a file).

    Create on the 2nd attempt the ghostplayer and load the x and y positions.

    Your game has a few more "players"...I would use the "s-plugin" and make 6 arrays with it, for the 6 lives.

    Here is a example made by toralord->

    He used the s-plugin to rewind the players action.

    Now you have to put the information, that is stored in the s-plugin, on the ghostplayer(the x and y positions for example).

    It's not that easy...but it's possible.

    If there is any easier way to do it, someone else will post it I think^^...

  • You know what would be a fantastic object? One that streamlines Toralord's example all into one object.

    Another idea would be an audio-video recording object that begins recording based on an event like: On Enter key pressed or on collision between Sprite A and Sprite B >>> record layout

    It could create an .avi that would save to it's own folder, and through event expressions we could call the file up from the folder. It would definitely need functions to have the file delete or save itself based on events, and allow the end user to save whatever recording he chooses... allow pauses, rewinds, and fast forwards...

    I know I'm just wishing out loud, but man that would be great!

  • You might want to ask Minor about this sort of thing. He's currently working on a game that does exactly this.

    You can see a video of it here in this thread:

    But I imagine it's rather complex, so I don't know how willing he is to divulge his work.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • It's pretty straightforward to record the players movement, it's basically a list of positions every frame. The first task is to choose a way to store all the positions, the Array or S plugins will do. Replying is just a matter of setting the player's position to the positions in the list one by one.

    For example I used the Array plugin here: ... eDrops.cap

    made in CC r1

    The "ghost" sprite is in a container with the Array object so that each "ghost" will have it's own list of positions. I keep track of which "ghost" to record the player's position to by a variable with the ghost's UID (unique id). When recording the player's position is always put in the last element of the array, then the array's size is increased by one. When replaying another variable is used to indicate what index of the array to read from. After the ghost positions are set from the arrays a that index the index is increased by one. You can also reverse the replay by decreasing by one.

    Another idea for using this with platform movement is recording and setting x/y velocity instead of position, that should help with having the replay's animations update.

  • Nice example R0J0!

    I can learn much from that .cap.

    Was it easy for you to make it? For me it would take a bit longer to make an example like this.

  • How would you record animation? or would it be automatic?

  • [quote:1kc88t7a]Was it easy for you to make it?

    It wasn't too difficult.

    [quote:1kc88t7a]How would you record animation? or would it be automatic?

    In toralord's time warp example he recorded the position, angle, velocity and animation frame of the player. It's the same case here just record those other value with the position.

  • Very interesting, it is exactly what I need. I will attempt to do the same with animation. Thanks

    Just a little question, In your Cap, you reset the position of the player at the re-start. Is it possible to reset the positions of all objets (Enemies, moving platforms,...) in the layout easily ? Or restart the entire layout without loose saved arrays ?

    In an advanced level, my hero will be able to shoot projectiles. Is it possible to record/play the shot if I wan't my clones shoot also ?

    thanks again.

  • I updated the example a bit to include animations.

    It now records position, angle, animation, animation frame and when the player shoots. I also changed it to just reset the layout instead of moving the player back to it's starting position. The ghost and array objects are now global so they aren't destroyed when resetting the layout.

    This has ended up being a very enjoyable example to work on.

  • Very nice. A very big thanks for this .

    It is perfect.

  • Question. What I wanted to the ghost to act like a top time. Mean, only one ghost would spawn, not many. Basically, the ghost would only show the fast time I completed the stage, like saving a file, then loading it.

  • Hey, what you need is a recorder to assist you with recording games. Here, I recommend A recorder named TuneFab Screen Recorder which helps you better in recording games.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)