Trouble with Transferring Movement
aduroanimus
Member Posts: 5
Hi. I'm making a labyrinth-style game where the player uses the accelerometer to control a ball and ultimately reach the end part of a level. After watching this video () I thought I'd be able to transfer motion easily from one scene to the next.
Here's my problem: the entrances and exits that vary from scene to scene are not 'clean'. By this I mean that the exit of one scene does not always evenly line up with the next scene's entrance. However, they are always on the appropriate side (for example, if I exited a scene from the right side of the screen, I would enter somewhere on the left side of the screen into the next scene, but not on the same location on the X or Y axis). This design was on purpose, as I don't want the player to just assume where they are entering the next scene.
Here's my question: how do I fake it? How do I transfer the velocity of the player object from one scene into the next? I hope I'm making sense, but I'll admit I'm a beginner to GameSalad (though not to game development).
Here's my problem: the entrances and exits that vary from scene to scene are not 'clean'. By this I mean that the exit of one scene does not always evenly line up with the next scene's entrance. However, they are always on the appropriate side (for example, if I exited a scene from the right side of the screen, I would enter somewhere on the left side of the screen into the next scene, but not on the same location on the X or Y axis). This design was on purpose, as I don't want the player to just assume where they are entering the next scene.
Here's my question: how do I fake it? How do I transfer the velocity of the player object from one scene into the next? I hope I'm making sense, but I'll admit I'm a beginner to GameSalad (though not to game development).
Comments
When attribute scene.completed=true --> change attribute game.velocityX to self.motion.linear velocity.x; Otherwise --> change attribute self.motion.linear velocity.x to game.velocityX
might work.
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User
Here's what I tried to do (in theory), but it ended up just crashing the game. Essentially, I was trying to 'save' the velocity of the player and then take the same velocity and implement it at the beginning of the next scene. So:
collide with exit -> save velocity -> open next scene -> player velocity = saved velocity.
I'm not sure why it crashed the game. Can you post a screenshot of your rules? And can you try it without saving/loading attributes? Try my suggestion if it makes sense now.
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User
Would it be possible to zip up the game so far and show you the player actor rules? They're rather long and complex, as they also include interactions with other mechanics.
You're welcome to .zip the file and send me a download link via PM (or post it here). I can't promise I'll look at it immediately but I'll see what I can do.
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User