I Need help
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
-
- Posts: 11
- Joined: Mon Jan 16, 2012 10:40 am
I Need help
I am a beginner and I am going to make my own game. I am enrolled in the academy
and I would like to know if there is a way to draw a line with your mouse and have
an object that is being shot out of a cannon hit that line and bounce off. There
will be different color lines representing the different bounciness. Is this
possible with live code and if so is there a tutorial in which I can figure this
out?
and I would like to know if there is a way to draw a line with your mouse and have
an object that is being shot out of a cannon hit that line and bounce off. There
will be different color lines representing the different bounciness. Is this
possible with live code and if so is there a tutorial in which I can figure this
out?
Re: I Need help
Easy and fun. It will take a bit of experimentation. That is the fun part.
Read up on the "intersect" function and the "within" function in the dictionary.
Write a script that moves an object around on the screen, and checks to see if there are any collisions. Don't let the object get lost.
Write back when you are good at doing that. Or when you cannot even get started.
Craig Newman
Read up on the "intersect" function and the "within" function in the dictionary.
Write a script that moves an object around on the screen, and checks to see if there are any collisions. Don't let the object get lost.
Write back when you are good at doing that. Or when you cannot even get started.
Craig Newman
-
- Posts: 11
- Joined: Mon Jan 16, 2012 10:40 am
Re: I Need help
Thank you for that and thanks in advance for any other advice.
-
- Posts: 54
- Joined: Fri Jan 20, 2012 6:08 pm
Re: I Need help
On a tutorial, from RunRev, it said that the intersection function requires a lot of processing, and is a good idea to use it only if needed.
In that example with an if statement it checked first if the object was close to where it could intersect, and then it use it.
Good idea to know that while coding!
In that example with an if statement it checked first if the object was close to where it could intersect, and then it use it.
Good idea to know that while coding!
Re: I Need help
I cannot imagine speed or processor burden is an issue with any sort of real-time LC action.
Let me know if I am wrong.
Craig Newman
Let me know if I am wrong.
Craig Newman
-
- Posts: 54
- Joined: Fri Jan 20, 2012 6:08 pm
Re: I Need help
That was said on the Game Academy, to tell you the truth, Im not sure how much it will impact the app.
Anyone instructor from the Academy to make this clear?
Thank you!
Anyone instructor from the Academy to make this clear?
Thank you!
Re: I Need help
I believe that the discussion was in the context of Galactic Gauntlet. It uses about 40 pieces for the lower terrain, 40 for the upper foreground and you can have 40+ enemies on the screen, so each frame needs to check 120+ intersections if you brute force it. By using selective IF statements to quickly exclude the 80 pieces that could not possibly intersect as too far away horizontally or vertically, you can save the cycles for the intersects that you truly need. Especially since the intersect uses an alpha transparency comparison, you're dealing with a lot of pixels, so you might as well use a little intelligent optimization where you can.
As someone else said, every cycle you save now gives you more horsepower for v2.0 where there are more sounds, more graphics and faster game play. So you might as well do it now even if the CPU can handle it all right now.
Kelly
As someone else said, every cycle you save now gives you more horsepower for v2.0 where there are more sounds, more graphics and faster game play. So you might as well do it now even if the CPU can handle it all right now.
Kelly
-
- Posts: 54
- Joined: Fri Jan 20, 2012 6:08 pm
Re: I Need help
Thanks for the clarification, and yes, that game was the one I was talking about.