Home Tutorials Forums Articles Blogs Movies Library Employment Press
Old 05-20-2003, 02:09 PM   #1
Smokey
Registered User
 
Join Date: May 2003
Posts: 32
Default Help With Game!!

alot of people have been very helpfull on here lately and hopefully i can get the same assistance here. i am creating a breakout style game trying to learn more about flash. i have the game itself created but i am having trouble with the following.

1.getting the ballcounter to work to show remaining balls.

2.designing the levels. all i have is the tile layout.( the level
storyboards are included in the zip file.)

3.the ball takes out alot of tiles on collision.

the main issue would be the design of the levels. i hope somone can help me. i have tapped all my resources and this project has 2 weeks till completion is a must. thanks for your help as well as all your past help.

Last edited by Smokey; 05-20-2003 at 04:41 PM.
Smokey is offline   Reply With Quote
Old 05-20-2003, 02:23 PM   #2
Smokey
Registered User
 
Join Date: May 2003
Posts: 32
Default

here are the files
Attached Files
File Type: zip game.zip (9.8 KB, 293 views)
Smokey is offline   Reply With Quote
Old 05-20-2003, 02:38 PM   #3
Smokey
Registered User
 
Join Date: May 2003
Posts: 32
Default

and the level storyboard
Attached Files
File Type: zip levels2.zip (28.0 KB, 274 views)
Smokey is offline   Reply With Quote
Old 05-20-2003, 08:05 PM   #4
CyanBlue
Super Moderator
 
CyanBlue's Avatar
 
Join Date: Jan 2002
Location: Centreville, VA
Posts: 26,666
Default

This is what I have so far...

I think number 1 is kinda done with this file... But I see that the hitTest() is not working properly... I guess you'd have to work on it some more before you implement the level stuff... See if you can do anything while I get some nap, and upload any progress... I'll take over when I get up... Oh... Just for your information, this is my full time non paying job...

Are you on F5 or FMX???
Attached Files
File Type: zip game2.zip (10.1 KB, 265 views)
__________________
CyanBlue / Jason Je / Macromedia Certified Flash Developer & Designer
http://CyanBlue.FlashVacuum.com
http://www.FlashVacuum.com
http://tutorials.FlashVacuum.com

Do NOT PM, Email or Call me... Your question belongs right in this forum...
CyanBlue is offline   Reply With Quote
Old 05-20-2003, 08:31 PM   #5
Smokey
Registered User
 
Join Date: May 2003
Posts: 32
Default

i am using fmx. im real new to this. thanx for helping out!!

Last edited by Smokey; 05-20-2003 at 08:37 PM.
Smokey is offline   Reply With Quote
Old 05-21-2003, 02:06 AM   #6
agent81
member
 
Join Date: Jan 2003
Location: Melbourne
Posts: 518
Default

Hey Smokey. I had similar issues with breakout recently. trouble is hitTest is a pretty bad way of doing it, not only do you have to chack every single tile, but there's no eal way of measuring an accurate angle for the bounce (if you have, then there is no use for hitTest in the first place).

its pretty hard to find a starting point to explain this, i took me a while to work out myself,

the replacement for hitTest is these two lines, where 'this' is referring to your ball
ActionScript Code:
var cell_x = Math.ceil((this.x-stageLeft)/blockWidth)-1;         var cell_y = Math.ceil((this.y-this.stageTop)/blockHeight)-1;
if you have laid out your blocks along a grid, then you now know which block the ball is over with two lines rather than a massive loop of hitTests.

next, you check to see if a block is there.

i do this by constructing a two dimensional array, at the same time as adding my blocks to the stage. put a variable is that says amHere = true

so you just need to say now
ActionScript Code:
if (blockArray[cell_x][cell_y].true){  this["block" + cell_x + "_" + cell_y].removeMovieClip() blockArray[cell_x][cell_y] = false }
hope that makes sense to you.
the next thing is to work out the angle the ball has to bounce at depending on which side of the block it has hit. I'll include the code that i used here, you would have to modify it for your own movie. but if you can make sense of it, it works a heap better than the method you are using at the moment.
ActionScript Code:
var path = this._parent.blockStore[cell_x][cell_y].path;                 var ylength = (this.y-this._y);                 var ymov = this.yspeed/Math.abs(this.yspeed);                 var tileY = path._y+(ymov*path._height);                 var pcnt = ylength/(tileY-this._y);                 var ballX_pcnt = (this._x-this.x)*pcnt;                 if (ballX_pcnt<0) {                     if (this._x+ballX_pcnt<path._x-(path._width/2)) {                         this.xspeed *= -1;                         this.x += this.xspeed;                     } else {                         this.yspeed *= -1;                         this.y += this.yspeed;                     }                 } else {                     if (this._x+ballX_pcnt>path._x+(path._width/2)) {                         this.xspeed *= -1;                         this.x += this.xspeed;                     } else {                         this.yspeed *= -1;                         this.y += this.yspeed;                     }                 }

if you have any questions then post them and I'll answer. Hope i havent just confused matters.
agent81 is offline   Reply With Quote
Old 05-21-2003, 03:22 AM   #7
CyanBlue
Super Moderator
 
CyanBlue's Avatar
 
Join Date: Jan 2002
Location: Centreville, VA
Posts: 26,666
Default

Very thorough, agent81... Thanks...

Hey, Smokey...

Why not try what agent81 said and let us know how it go???
__________________
CyanBlue / Jason Je / Macromedia Certified Flash Developer & Designer
http://CyanBlue.FlashVacuum.com
http://www.FlashVacuum.com
http://tutorials.FlashVacuum.com

Do NOT PM, Email or Call me... Your question belongs right in this forum...
CyanBlue is offline   Reply With Quote
Old 05-21-2003, 05:01 PM   #8
Smokey
Registered User
 
Join Date: May 2003
Posts: 32
Default

i'll give it a shot. im pretty quick but also very new!! hopefully i can figure it out. thanx
Smokey is offline   Reply With Quote
Old 05-22-2003, 01:22 PM   #9
Smokey
Registered User
 
Join Date: May 2003
Posts: 32
Default

having trouble transferring the code into my application. also the levels are still giving me hell.
Smokey is offline   Reply With Quote
Old 05-22-2003, 02:24 PM   #10
CyanBlue
Super Moderator
 
CyanBlue's Avatar
 
Join Date: Jan 2002
Location: Centreville, VA
Posts: 26,666
Default

Um... You need to be abit more specific and precise than that... Show us where you are having problems with, at least...
__________________
CyanBlue / Jason Je / Macromedia Certified Flash Developer & Designer
http://CyanBlue.FlashVacuum.com
http://www.FlashVacuum.com
http://tutorials.FlashVacuum.com

Do NOT PM, Email or Call me... Your question belongs right in this forum...
CyanBlue 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

Similar Threads
Thread Thread Starter Forum Replies Last Post
FlashGameLicense.com - virtual marketplace to connect game developers and buyers AdamSchroeder General Chat 0 12-18-2007 09:16 PM
My first video game! / Test it! janevblagoj Gaming and Game Development 0 08-26-2007 07:18 AM
Nietzsche: My first AS2 game SHDR Gaming and Game Development 2 07-16-2007 08:13 AM
Rate My Game, plz fill the questioner UzumakiJr Site Check 0 12-16-2006 08:48 PM
[AS2] Card Game (turn-based) - Lobby Room and Game Room, maintain state cururu Gaming and Game Development 3 05-20-2006 02:06 AM


All times are GMT. The time now is 09:04 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.