Chomper Stomping
jQuery/JavaScript/CSS 3/HTML 5, Java/PHP/Python/ActionScript, Git, Chrome/Firefox Extensions, Wordpress/Game/iPhone App Development and other random techie tidbits I've collected



flash games

September 25, 2007

The Ball Won’t Bounce…

More articles by »
Written by: Christopher McCulloh

When I purchased “Basics of Actionscript 3.0 For Animation” I assumed that I knew enough actionscript to retrofit it for Flash 8, and that once I got Flash 9 I could benefit from the newer stuff in the book.

I may have made a mistake.

There is a free compiler available from Adobe so that you don’t have to actually have Flash 9 to write for it. I hacked out the bounce example from the book and compiled it. It worked great.

So I took it and tried to apply it to my code for my metroid/marble game (I had to change it a lot because I was using solid hit-testing instead of distance measurements, see yesterday’s post on triangles). It didn’t work. The ball just bounces as if it is hitting flat ground. After spending more time on this than I care to admit, I decided to just start from scratch.

It takes me about 45 minutes to retrofit the flash 9 code to flash 8 code (ActionScript 3.0 to ActionScript 2.0) but I got it done. It was almost line for line the exact example from the book. The same one that worked flawlessly when I typed it up and used the Flash 9 compiler. So I’m ready to go, it’s got to work, right? Wrong. It just bounces straight up as if it were hitting a flat surface instead of an angle.

How can this be? I have no idea, but my lunch break is up, and that’s all I can do for the day. If some flash guru happens to stumble upon this and knows what’s going on, feel free to let me know. Thanks.

See the dismal failure here.

Download the Source here.



About the Author

Christopher McCulloh
E-Commerce developer at Finish Line Co-Author of HTML, XHTML and CSS All-in-one Desk Reference for Dummies Graduated from IU with a Bachelors of Media Arts and Science and a Certificate in Applied Computer Science. Tech Editor for Building Facebook Applications for Dummies and Building Websites All-in-one for Dummies 2nd Edition. Creator and maintainer of the Status-bar Calculator Firefox Extension Three years professional experience in Java E-Commerce Development and four years professional experience with PHP for a combined total of seven years professional JavaScript/HTML/CSS experience




 
 

 
mysqlerror

WP phpBB Bridge: Warning: mysql_set_charset() expects parameter 2 to be resource, boolean given

Warning: mysql_set_charset() expects parameter 2 to be resource, boolean given in wp-content/plugins/wp-phpbb-bridge/inc/widgets/wpbb_topics_widget.php on line 149 This is an error caused by the fact that the WP phpBB Bridge pl...
by Christopher McCulloh
0

 
 
 

Events Calendar Pro Nav Formatting Messed up on Empty Calendar

The Events Calendar Pro (from http://tri.be/) has a few problems. If you are trying to figure out why a calendar with no events in that month has completely screwed up header navigation, just put this line of code inside of tab...
by Christopher McCulloh
3

 
 
warning

OH SHNIKES, WE’VE BEEN HAXORED!!!

Yes. It finally happened. After… 6 years? on the web I finally got hacked. Two domains affected: http://cmcculloh.com http://hallelujahbutton.com (this also of course affected all sub-domains of cmcculloh.com, such as blo...
by Christopher McCulloh
1

 

 
blue-xl

WordPress Settings API – Adding Options to Existing Page

Adding new options to an existing page in the dashboard in wordpress can be maddening. I’ve literally spent 15+ hours dealing with this horrible API at this point. To the point where I wrote two different wrappers for it....
by Christopher McCulloh
0

 
 
custom_ratings

Teaser of things to come…

Lots going on at ChomperStomp right now. I’ve been up to my eyeballs in work and in babies (3 month old and 2.5 year old). Here’s a little teaser for something big I’m working on: That’s right, custom us...
by Christopher McCulloh
0

 




0 Comments


Be the first to comment!


Leave a Reply

Your email address will not be published. Required fields are marked *

*


1 × five =

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>