Home Tutorials Forums Articles Blogs Movies Library Employment Press

Go Back   ActionScript.org Forums > General > Gaming and Game Development

Reply
 
Thread Tools Rate Thread Display Modes
Old 07-29-2009, 09:37 AM   #1
David Lindh
Registered User
 
Join Date: May 2007
Posts: 8
Red face [AS3] Bouncing Ball game

Hello,
I'm under construction of my first flash game and have some questions.

First of all here is a link to the game.

Control the ball sideways with left and right arrow on the keyboard. Make the ball bounce by pressing the down key when the ball is falling.

My first question is, what do you think is the best way to solve this game.

Right now i have 2 things to control the ball, 1 class that calculating the movments and one ball movieclip that I pass the X and Y values from class.
It feels like it posible to create one class that calculates the movment and displays the ball.
The same things goes to the enemies.

Last edited by David Lindh; 09-14-2009 at 10:10 PM.
David Lindh is offline   Reply With Quote
Old 07-29-2009, 11:17 AM   #2
David Lindh
Registered User
 
Join Date: May 2007
Posts: 8
Default

Made some progress on the ball class. Now it extends the functionality from movieClip and displays both the ball and the shadow.
I also started on a new solution to create the enemies.

I updated the code in the first post with the new one.
David Lindh is offline   Reply With Quote
Old 07-29-2009, 12:05 PM   #3
David Lindh
Registered User
 
Join Date: May 2007
Posts: 8
Default

With the new enemy class im down to 99 lines of code in the main timeline.
David Lindh is offline   Reply With Quote
Old 07-29-2009, 02:28 PM   #4
David Lindh
Registered User
 
Join Date: May 2007
Posts: 8
Default

Now I made a menu to choose difficulty.
The first frame is the menu and on the second frame the game begins. When the ball hits something Im going back to frame 1 but i get this error:

TypeError: Error #1009: Cannot access a property or method of a null object reference.
at ballGame_fla::MainTimeline/frame1()
at flash.display::MovieClip/gotoAndStop()
at ballGame_fla::MainTimeline/finishLevel()
at ballGame_fla::MainTimeline/frameloop()
TypeError: Error #1010: A term is undefined and has no properties.
at ballGame_fla::MainTimeline/frameloop()
David Lindh is offline   Reply With Quote
Old 09-14-2009, 12:05 PM   #5
David Lindh
Registered User
 
Join Date: May 2007
Posts: 8
Default

Today I finally took the time to complete my game.

Here is the final game.

Last edited by David Lindh; 09-14-2009 at 10:11 PM.
David Lindh is offline   Reply With Quote
Old 09-16-2009, 07:47 AM   #6
tango88
FlashByNight.com
 
tango88's Avatar
 
Join Date: Aug 2006
Posts: 289
Default

Hey, cool, you got a nice smooth bouncing motion.

I had to learn a few words of (Swedish?) to navigate.
__________________
Games and more:
Flashbynight.com | Tutes | Twitter
tango88 is offline   Reply With Quote
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 09:27 AM.

///
Follow actionscriptorg on Twitter

 


Powered by vBulletin® Version 3.8.5
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Ad Management plugin by RedTyger
Copyright 2000-2013 ActionScript.org. All Rights Reserved.
Your use of this site is subject to our Privacy Policy and Terms of Use.