Getting A Ball To Roll

ChessPawnChessPawn Member Posts: 127
edited November -1 in Working with GS (Mac)
Hi there. I just started using GameSalad yesterday, and I love it. However, I did have a question. In my game, I have a ball and a box. So the ball starts at the top, and when the user presses GO!, the ball drops down. So before hitting GO!, the users is supposed to draw a path so that the ball can roll down the path, like a roller coaster. So it has to use some sort of physics so that the ball gains momentum as it goes down, but if there isn't enough, it'll just roll back the other way. Also, I don't know whether I used the right method to get the ball to drop. I just have the button change an attribute so that the ball accelerates at 270 (down). PLEASE HELP!

P.S. I have only programmed in Visual Basic before, and I am only in Grade 9.

Comments

  • dmilinovichiiidmilinovichiii Member Posts: 620
    I'm in 9th grade also. To make the ball drop, put an accelerate attribute in the ball and set it to accelerate down relative to scene. Change the number to however fast you want the ball to fall. To make the ball roll, make sure that the movable attribute on the left under Physics I think is checked and the rotation lock is unchecked. Set the Friction at something like 50. Make sure the collision shape is a circle. Add a collision attribute to the ball to make it collide with the path. This should get you started. I just wanted to let you know, being in the same grade, that this is a really advanced project that I might try now after using GameSalad for over a year. You might want to set this aside and try something easier until you are more experienced and then come back to this. It sounds like a great idea though so don't give up on it completely.
  • IncrediboIncredibo Member Posts: 274
    You can but Darren's Bumps Template it's kind of similar to what you want.
  • ChessPawnChessPawn Member Posts: 127
    Thanks Mr.Rinoy. That worked perfectly. I actually have a few levels done, so maybe I'll post it on the Web…

    My question now is: Does the ball use physics by default. I mean, does it gain momentum and such already, or do I need to change something.

    Thanks! :P
  • JohnPapiomitisJohnPapiomitis Member Posts: 6,256
    youll need to add a downward acceleratrion on the ball relative to scene to simulate gravity, then it will roll down hills and such
  • dmilinovichiiidmilinovichiii Member Posts: 620
    ChessPawn said:
    Thanks Mr.Rinoy. That worked perfectly. I actually have a few levels done, so maybe I'll post it on the Web…

    My question now is: Does the ball use physics by default. I mean, does it gain momentum and such already, or do I need to change something.

    Thanks! :P

    It should work by default. Make sure that the values of the density, drag, and resituation (bounciness) are at the amounts that you want. If you have any questions you want to ask me directly, email me at Mr.Rinoy@gmail.com
  • RedlerTechRedlerTech Member Posts: 1,583
    I can help :)
    _________________________________________________________________________________
    GameSalad Community Project
    Quality Game Making Service
    1 On 1 Project Help
  • ChessPawnChessPawn Member Posts: 127
    OK so now that's working, and I have my play button and clear button working fine. However, what I want is that when user hits stop, the ball goes back to its original position, while still keeping all the drawing. (I don't think I can use reset…) So I used a rule that when stop is pressed, attribute game.BallMove is false. So then, under the ball I said, when game.BallMove is false, "MOVE", and entered the coordinates of the starting position. But, the ball slides, and I just want it to reappear there. Any ideas?
  • JohnPapiomitisJohnPapiomitis Member Posts: 6,256
    use change attribute instead of move and change the x and y to exactly what u want. Move doesn exactly that, it moves it thats why its slidding
Sign In or Register to comment.