Hi everyone!
Sorry, I’m in over my head here. I’ve created a game sucessfully but when I added a second player and character select screen, I can no longer move either one.
Please can someone assist my feeble mind?
Thanks in advance,
Mikey.
Hi everyone!
Sorry, I’m in over my head here. I’ve created a game sucessfully but when I added a second player and character select screen, I can no longer move either one.
Please can someone assist my feeble mind?
Thanks in advance,
Mikey.
You’ve got the change animation withing the “At the beginning of the scene” block. It will only get actioned once, when the scene first loads.
You’ll need to move (outdent) those animation and keypress events to be as far left in the event tree as possible.
Hi MrMen,
Thank you so very much for assisting me.
I have done this and the characters now display and move but they drag along the screen like the completion of Soliataire. Sorry, I’m green on this.
Mikey
You’ve moved too many events. Events 2 & 3 need to be moved right, so they sit under the first event (the one starting with “At the beginning…”). Because as it stands, a new character is created every frame at the player position. You only want to do this once.
Also, once you get this working, you should look at adding the player characters to an object group, and using that for character creation and control. You’ll then have one set of events to control and monitor for collisions for as many player objects as you like, rather than a separate set of events for each object. But we can deal with that once you have the movement sorted out.
Thanks again!
OK, now the characters are stuck but movement still takes place as I can collect coins but am invisible.
It looks like you are following 2 players with 1 camera, try removing one of the camera actions or add a variable to check which player to follow.
As @Epicsleeper pointed out, you’ve got 2 camera position actions. The last one will set it to player2’s position, and it that doesn’t exist, then it defaults to 0.
I suggest you take out all the references to Player2, and get it working for one player again.
Once you’ve done that, we can help to get it working with 2 or more characters, with minimal changes and only 1 extra event.
You need to add a line that positions Player1 on PlayerHitBox. Otherwise the PlayerHitBox object moves, but the Player1 image doesn’t.
Also, change the camera positioning to PlayerHitBox.X().
Yes, because you are only positioning the Player1 object once - at the beginning of the scene. It’s a subevent action of the “At the beginning of the scene” event, and so will only get actioned once.
Drag that action (just the positioning of Player1) to the same event you have the camera positioning. So you position the Player1 object, and then set the camera’s x position.
It should then work. And after that we can make the changes to get it working for multiple player characters.
Ok thanks again.
I can now move left and right but I’m under the floor level and cannot jump.
Unsure what I did but I was playing the game fine before trying to add Player2.
Thank you so very much for your help, this is the nicest forum I’ve been a part of.
In the scene editor, where is the PlayerHitBox object placed?
And can you give another screen shot, but expand the “PlayerHitBox is jumping” and “PlayerHitBox is on floor” events?
No worries. It’s a bit quiet at work, so I’m jumping between the forum and real life
That looks ok.
Is the character under the floor from the start (or very soon after)? Or does it happen during gameplay?
Can you then screen shot the game in play to show what it looks like and where the player character is placed?
Check the Collision Mask on your PlayerHitBox object - it’s probably reduced to nearly nothing. You’ll need to expand it to the size of the PlayerHitBox image.