spawn new ball
wongj19
Member Posts: 45
in Help Wanted
How can I make it so that when my ball is moved off it's starting position, a new ball spawns.
Also how can I make my game so that gravity doesn't affect the ball until it is moved off the starting position.
Any help appreciated.
Comments
Depends on your controls? How are you grabbing the ball. Can you slam dunk? Remember everything is logic with code. Things do what you tell it to do when. These two videos should give you some ideas.
As to your main questions an easy way would be to have an invisible actor where the ball starts. From that actor you can track and spawn a new ball.
So in invisable actor
Rule
When overlaps and collides with ball
In the otherwise section
Spawn ball
Position X 0 Position Y 0 related to actor.
Guru Video Channel | Lost Oasis Games | FRYING BACON STUDIOS
Thanks, I never thought about this
Yes you would be able to slam dunk by grabbing the ball. Does this information help in coming up with a solution for the ball to not move until it is flicked? (Gravity doesn't affect the ball until flicked for the first time) if you can help, pls reply
@wongj19 Hey , I attached a demo not sure if this is what your looking for.
Hope it helps
@Icebox -- great demo. You are on fire this week!
@RThurman Thanks !
This is a really nice demo, but sadly I was looking more of a flick gesture to move the ball. If u have time could you please make another demo as this would really help me. Thanks
I tried this but is just spawns 2 balls. It also lags the apps so that I can't flick the ball anymore. Is there another way to do this?
This is what I'm doing at the moment. @Lost_Oasis_Games
. Also add a timer to the spawn, like after .5 or whatever pace of time you want. Set the spawn to 0x-0Y and relative to actor. Show me your flick rules.
Guru Video Channel | Lost Oasis Games | FRYING BACON STUDIOS
Try this. Here is a proper flick throw with a basic spawn mechanic.
Guru Video Channel | Lost Oasis Games | FRYING BACON STUDIOS
Guru Video Channel | Lost Oasis Games | FRYING BACON STUDIOS
heres my coding for throwing the ball that I copied off youtube. Which way should I use yours or mine. @Lost_Oasis_Games
I also made my game so that if the ball bounces on the walls of the screen more than 6 times, the ball disappears. How can I make my counter different for every ball? Heres the coding that i have at the moment. (not very good as I made it myself)
Okay so a counter for each ball should be done with a self attribute.
In prototype actor of ball make a self integer. Bounce_Count
Now just replace self.bounce_count with your game.ball bounce attribute in the code you showed.
Your code for throw looks fine other than you don't need to do those change attributes for touch X and Y. No need for those.
Guru Video Channel | Lost Oasis Games | FRYING BACON STUDIOS
@IceBox @Lost_Oasis_Games can I ask what programs you use to capture your screen and save to gif please?
@KevinCross i record a video with quicktime and type in google 'video to gif' and choose the first link . u upload the video on their site and it turns it to gif save it and upload it here. i dont know if its ok i put a direct link here
Ok thanks. I thought there might have been a program that did it in one or two simple clips.