An odd movement
BonepileGames
Member Posts: 194
Hello to GS Community,
I have a main actor who changes its motion linear y too +100 when collides with a platform which constantly changes its motion linear x to -100. I have a spawner who spawns every random 1 to 3 seconds a platform. The platforms move from right to left obviously. I have a constrain behaviour in platform(prototype) which sets game.x to self.position.x and the same for Y axis. I have another constrain behaviour into the main actor which sets game.XX to self.position.x - game.x within a RULE, which is 'when overlaps or collides with platform' and the same for Y axis. Back to the platform prototype, I made a rule ,which says 'if/when game.xx >= 0' change attribute self.motion.linear.x to '-100-(game.xx*10)'. The idea behind this is to make the platforms move faster if the main actor's X is higher than the platform's Xwhich he collides with. The difference between X-es is the number multiplied by 10, added to the motion.linear.x of the platforms.
Everything works great.
However, one of five platforms spawned moves with motion.linear.x (-100), which is the initial one. In other words, it is not affected by the difference of the X-es of the main actor and the platform before that.
NOTE: I have changed collision shape of platforms to CIRCLE.
Anyone, who knows what I am doing wrong?
I would ask Socks, Tatiang and other cool guys, who help miserable souls struggling to create a game with this almost-unlimited software, but I do not know if it is "legal". @Socks @tatiang
Socks, tatiang, if you want to remove the @ tell me.
For those who would like to help but the description is insufficent, I can send my project to investigate it more carefully.
Thank you
I have a main actor who changes its motion linear y too +100 when collides with a platform which constantly changes its motion linear x to -100. I have a spawner who spawns every random 1 to 3 seconds a platform. The platforms move from right to left obviously. I have a constrain behaviour in platform(prototype) which sets game.x to self.position.x and the same for Y axis. I have another constrain behaviour into the main actor which sets game.XX to self.position.x - game.x within a RULE, which is 'when overlaps or collides with platform' and the same for Y axis. Back to the platform prototype, I made a rule ,which says 'if/when game.xx >= 0' change attribute self.motion.linear.x to '-100-(game.xx*10)'. The idea behind this is to make the platforms move faster if the main actor's X is higher than the platform's Xwhich he collides with. The difference between X-es is the number multiplied by 10, added to the motion.linear.x of the platforms.
Everything works great.
However, one of five platforms spawned moves with motion.linear.x (-100), which is the initial one. In other words, it is not affected by the difference of the X-es of the main actor and the platform before that.
NOTE: I have changed collision shape of platforms to CIRCLE.
Anyone, who knows what I am doing wrong?
I would ask Socks, Tatiang and other cool guys, who help miserable souls struggling to create a game with this almost-unlimited software, but I do not know if it is "legal". @Socks @tatiang
Socks, tatiang, if you want to remove the @ tell me.
For those who would like to help but the description is insufficent, I can send my project to investigate it more carefully.
Thank you
This discussion has been closed.
Comments
@Socks and I have a "jump ball" system and he has the possession arrow so I'll let him have a go.
In the meantime, you're welcome to send the project file (please .zip it first) to one or both of us. I don't have a lot of time right now so it might be a day before I can get back to you.
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User
http://www.mediafire.com/download/rjex2zq9di4jdka/Project.rar
If you are willing to give me a hand that would be great!
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User
First of all, thank you for your help.
I did what exactly you did but the issue right now is that none of the platforms are moving faster when the main actor collides on the right part of the circle
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User
I've changed the rules and want to accomplish something else.
There is still a spawner, but the tricky thing here is that the player will initially be able to spawn 5 platforms when touching a certain area of the screen (top-left). One touch is one spawn of a platform. There will be objects which should be taken in order to get more points, which will let you spawn more platforms. Obviously, if you dont take those objects you wont be able to spawn platforms which means you will die (not in real life ofcourse ).
However, I experience a minor issue on my way of creating this interesting game. When you spawn a platform BEFORE you collide with a platform, it works great. The spawned platform changes its velocity to the formula (-100-(game.XX*10)) where game.XX is the difference between player.position.X and platform.position.X after collision. The problem is that when you spawn a platform AFTER collision with previous platform, sometimes the spawned platform doesnt change its velocity to its formula. I tried constrain attribute with a timer of Every 0.1 seconds but no difference at all.
Can you come up with any idea regarding this matter?
Thank you for your help once again.
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User
I have made a significant progress developing the game, however I experience another minor issue.
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
This is the link for the updated project.
I would like when the player collides with the platform, platforms move with a speed determined by the rule, you already know about it. Then when your touch is inside Left Fan button it makes the platforms move faster and when the touch is outside to make them move with the speed again determined by the last collision.
I made this thing at 99%.
Tatiang, experiment by clicking on Left and Right Fan buttons. The moves of the platforms are different when the actor collides with the previous platform to its right and left.
To explain to you, what should those buttons do:
1) Left Fan button - Make platforms move faster, when release the touch on this button to change platforms speed to that determined by the last collision with a platform.
2) Right Fan button - make platforms move slower. If you hold that button for more seconds than one it will make the platforms move in a right direction (imitating your main actor is getting back), then when release the button to change platforms speed to that determined by the last colliosion with a platform.
Thank you once again.
I think you have your fan image backwards. When you use the right fan, it should appear to blow air to the right to slow down the platform.
As for the movement speeds, I'm having a tough time getting a handle on that. I'm sorry, but I just don't have enough time to put into sorting through the rules right now. I would say I'd take it on as a paid project but I have several clients I'm helping at the moment so I'm not sure when I could get to it. Send me a private message if you're interested in that, though, and I'll let you know.
Hopefully someone else here can take a look and help out!
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User
Thank you for your attention. I appreciate your input.
Keep up the good work!
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User