Just Join $99 need a little help

UtopianGamesUtopianGames Member Posts: 5,692
edited November -1 in Working with GS (Mac)
Hi Guys,

Signed up to the $99 to make iPhone games, i've come from a game maker background so it's all a little differnt.

Im trying to have a single room with a 480x320 view and have small balls 48x48 bounce around within this area.

Any help to get the balls to start moving at a random direction when the room starts and bounce off each other would be great.

I also cant find anything that stops the balls going out of view so am i correct in thinking theres no wrap limit available to stop the balls going off screen and i need to make some blockers out of view to bounce the balls back in?

Thanks in advance,

Darren.

Comments

  • scitunesscitunes Member, Sous Chef Posts: 4,047
    Make an acotr called wall. Put a collide behavior in it to make it collide with the balls. Uncheck visibiity and uncheck movable.

    Then in the ball actor put a change velocity behavior and use the expression editor in the angle section (the little "e"). In the expression editor click on random. Change the x,y to the lower and upper limits for the angle. The game will then select a random angle between those limits. You could also create a rule that says

    Rule
    when collides with wall
    change velocity (just copy the one from above). Then it will bounce off the wall at a completely random angle (which won't look natural but could be useful for certain games)
  • BeyondtheTechBeyondtheTech Member Posts: 809
    There is also Wrap X and Wrap Y in the Scene Attributes. Go to your main game scene, then click Scene above the Actors and go into Attributes, then check both boxes. Of course, it won't bounce off the wall, but it will wrap to the opposite side, if that's what you want. Otherwise, create invisible walls as stated above.
  • UtopianGamesUtopianGames Member Posts: 5,692
    Thanks guys,

    I need the balls to bounce off each other and the wall in a way that looks natural....i will have a play and get back.

    Darren.
  • firemaplegamesfiremaplegames Member Posts: 3,211
    when you open gs, look in the shared games tab. do a search for "codemonkey". he has a demo that shows balls bouncing around the screen. that will get you started. to make the balls bounce off of each other, you'll need to add a collide behavior to the ball actor.
  • UtopianGamesUtopianGames Member Posts: 5,692
    Managed to work it out thanks guys...now i have them bouncing and rotating.

    All i need now is to work out how to touch the screen and if ball is within a certain distance of the initial touch make it go -180 away from the touch.

    Imagine fish in water and your the wave machine..best describes it.

    Darren.
  • firemaplegamesfiremaplegames Member Posts: 3,211
    for that, you'll use the magnitude method in the expression editor...
  • BeyondtheTechBeyondtheTech Member Posts: 809
    You can have an invisible ball that's as large as the initial wave, just lay it down on top of the mouse position and all the balls should react away from it, no?
Sign In or Register to comment.