PDA

View Full Version : [AS3] Ball Throwing Game


JesseJanzen
12-15-2008, 07:48 PM
Hi there folks!

I've looked all over the web, but couldn't find a decent tutorial about the thing I need.. Maybe one of you guys could help me out for my school project..

Here's what I would like to achieve:

http://blog.circlecube.com/2007/03/01/gravity/ (http://blog.circlecube.com/2007/03/01/gravity/)


A simple ball which you can throw by dragging it with your mouse..
The thing is, it has to be in AS3.. so unfortunatly I can't use the above tut ;-)

I hope someone can help me out here, so I know where to start..

Thanks in advance!

Jesse

lordofduct
12-15-2008, 07:53 PM
The source code for it is in that link....

JesseJanzen
12-15-2008, 07:56 PM
The source code for it is in that link....
Yeah, but it's in AS2.. And I really need it to be in AS3..

lordofduct
12-15-2008, 08:02 PM
My point is, how can you get any better of a tutorial then that?

You're writing AS3 now, converting AS2 to AS3 will probably help you learn AS3 better then if someone else converted it all for you. It's only 70 lines of code, take a shot at it.

I could take the time to break it all down for you and explain everything... but you're still gonna have to write the code (if I just give you the code, that isn't a tutorial, that's just me doing your work).

JesseJanzen
12-15-2008, 08:06 PM
My point is, how can you get any better of a tutorial then that?

You're writing AS3 now, converting AS2 to AS3 will probably help you learn AS3 better then if someone else converted it all for you. It's only 70 lines of code, take a shot at it.

I could take the time to break it all down for you and explain everything... but you're still gonna have to write the code (if I just give you the code, that isn't a tutorial, that's just me doing your work).
Hm, you could be right there, but im not really into AS2 as well.. I just know the basics of it, so im now just started from scratch with AS3..

And of course it wasn't my meaning to let you do my work.. but maybe someone knew a look a like of this one, only in AS3.. Or some usefull tutorials about the gravity & draggin..

I'm not trying to duplicate this thing, but I want to make something that looks a bit similar to it..

But if you say it's not such a big of a deal to convert it, I'll give it a shot

Thx

fitz
12-15-2008, 09:22 PM
Looked at the source. Yea, you should WANT to convert it to AS3, especially if you are new to AS3. It will give you a chance to learn in the process. Plus, you don't have to "convert" it so much as just understand how it's done, and then do it in AS3. It's not very complex. Once you get something going in AS3, and run into a problem or something, that's what we're really here for.

rrh
12-15-2008, 09:31 PM
That tutorial links to another tutorial by Keith Peter that breaks the physics down very well.

The biggest difference is how the two handle events. The old thing has things like on(press){ which is basically defining a function that's triggered when the 'press' event occurs.

For AS3 you handle events a little differently, where you need to explicitly use addEventListener and define the function you want to be called. That's the biggest conceptual difference you'll need to get your head around.

JesseJanzen
12-15-2008, 09:34 PM
Allright Thanks.. I'm going to give it a shot.. Thanks for playing the teacher, guys ;-)