Play free games online!


Go Back   The Game Homepage Forums > Development > Flash Development

Reply
 
LinkBack Thread Tools Display Modes
  #11  
Old 05-05-2008, 12:38 AM
nàme's Avatar
Gamer
RoboRaptor
Better than 87.70% Better than 87.70% Better than 87.70%
 

Join Date: Aug 2007
Location: edmonton
Posts: 3,332
nàme is on a distinguished roadnàme is on a distinguished road
Default

yay! testing is fun!
__________________
(\ (\
( ^_^)
(_(")(")
This is Bunny. Copy and paste bunny into your sig to help him gain world domination...
(\/)
(-_-)
(")(")
This is Bunny's friend. Copy and paste Bunny's friend for back-up...
/\_/\
( .. )
(")(")
This is robot-bunny. He will dominate everything who stands in Bunny's path...
|\_/| _______.
|^^|| ' |
|'') |'')
Bunny's bodyguard carries a gun everywhere he goes...
(\__/)
( O.o)
(> < ) Its a demented bunny...
(\(\ ~~ be a bunny ~~
(='.')~~ make war ~~
o(_")")~~ not luv ~~
Reply With Quote
  #12  
Old 05-05-2008, 12:04 PM
Gaz's Avatar
Gaz Gaz is offline
Administrator
Power Drill
Better than 63.31% Better than 63.31% Better than 63.31%
 

Join Date: Jun 2007
Location: Ipswich, UK
Posts: 1,022
Gaz is a splendid one to beholdGaz is a splendid one to beholdGaz is a splendid one to beholdGaz is a splendid one to beholdGaz is a splendid one to beholdGaz is a splendid one to beholdGaz is a splendid one to beholdGaz is a splendid one to beholdGaz is a splendid one to behold
Default

Try this:

Code:
numtotest = 3;

for (i=1 ; i <= numtotest ; i++) { 
   if (_root["hit"+i].hitTest(_root.ball.ballHit)) {
        xspeed = 0;
        yspeed = 0;
        _x = 192;
        _y = 27;
        _root.score--;
        _root.lives--;
        if (_root.lives<1) {
            _root.fadeoutfail.gotoAndPlay(2);
            _root.ball.gotoAndPlay(2);
        }
    }
}
That should test aganst _root.hit1, _root.hit2 and _root.hit3. If you want to test more just increase 'numtotest'




Quote:
Originally Posted by NiallTL View Post
Ah, true, very true. Never actually thought of that. Thanks again.

Next question!

My character has a lot of hittests to manage, as it's a navigate ballgame sort of thing. The trouble is, I have loads of code, just repeats changing the instance name.

Snippet:

Code:
if (_root.hit1.hitTest(_root.ball.ballHit)) {
        xspeed = 0;
        yspeed = 0;
        _x = 192;
        _y = 27;
        _root.score--;
        _root.lives--;
        if (_root.lives<1) {
            _root.fadeoutfail.gotoAndPlay(2);
            _root.ball.gotoAndPlay(2);
        }
    }
    if (_root.hit2.hitTest(_root.ball.ballHit)) {
        xspeed = 0;
        yspeed = 0;
        _x = 192;
        _y = 27;
        _root.score--;
        _root.lives--;
        if (_root.lives<1) {
            _root.fadeoutfail.gotoAndPlay(2);
            _root.ball.gotoAndPlay(2);
        }
    }
etcetera through all the ones, hit1, hit2 etc etc etc.

I was wondering if there is any way to merge hits, like so I could have something like:
Code:
(_root.hit2, hit3, hit4.hitTest(_root.ball.ballHit)) {
And so on, so I don't have humongous code.

Any way to sort this? Thanks.
Reply With Quote
  #13  
Old 05-05-2008, 08:42 PM
NiallTL's Avatar
Gamer
Tin Can
 

Join Date: Mar 2008
Location: Yes.
Posts: 33
NiallTL is on a distinguished road
Send a message via MSN to NiallTL Send a message via Skype™ to NiallTL
Default

Oh joy again!
You are truly a lifesaver Gaz, thank you so so much, you will get credited - a lot :3
Thanks again. If I have an y more questions I'll post 'em here
__________________
'Lo peoples. I'm NiallTL (Neel Tee Ehl).

Eh, I don't have to put effort into this, do I?
Reply With Quote
  #14  
Old 05-05-2008, 09:18 PM
Gaz's Avatar
Gaz Gaz is offline
Administrator
Power Drill
Better than 63.31% Better than 63.31% Better than 63.31%
 

Join Date: Jun 2007
Location: Ipswich, UK
Posts: 1,022
Gaz is a splendid one to beholdGaz is a splendid one to beholdGaz is a splendid one to beholdGaz is a splendid one to beholdGaz is a splendid one to beholdGaz is a splendid one to beholdGaz is a splendid one to beholdGaz is a splendid one to beholdGaz is a splendid one to behold
Default

no probs
Reply With Quote
  #15  
Old 05-06-2008, 12:54 PM
NiallTL's Avatar
Gamer
Tin Can
 

Join Date: Mar 2008
Location: Yes.
Posts: 33
NiallTL is on a distinguished road
Send a message via MSN to NiallTL Send a message via Skype™ to NiallTL
Default

Here I am again with a brand new problem
Each level is programmed on a single frame each, so I can't use a stop(); code, I'd like to be able to have it so that when you press P it pauses the game, so it pauses the music, character, everything. Then when you press P again it unpauses. Sort of like in metro siberia underground > Salomonsson.se
Any help please? Thanks
__________________
'Lo peoples. I'm NiallTL (Neel Tee Ehl).

Eh, I don't have to put effort into this, do I?
Reply With Quote
  #16  
Old 05-06-2008, 01:47 PM
Gaz's Avatar
Gaz Gaz is offline
Administrator
Power Drill
Better than 63.31% Better than 63.31% Better than 63.31%
 

Join Date: Jun 2007
Location: Ipswich, UK
Posts: 1,022
Gaz is a splendid one to beholdGaz is a splendid one to beholdGaz is a splendid one to beholdGaz is a splendid one to beholdGaz is a splendid one to beholdGaz is a splendid one to beholdGaz is a splendid one to beholdGaz is a splendid one to beholdGaz is a splendid one to behold
Default

Quote:
Originally Posted by NiallTL View Post
Here I am again with a brand new problem
Each level is programmed on a single frame each, so I can't use a stop(); code, I'd like to be able to have it so that when you press P it pauses the game, so it pauses the music, character, everything. Then when you press P again it unpauses. Sort of like in metro siberia underground > Salomonsson.se
Any help please? Thanks
There's no easy solution I'm afraid you've just got to look at how you've done all the individual functions etc. + figure out how best to stop/restart them.
Reply With Quote
  #17  
Old 05-06-2008, 07:29 PM
NiallTL's Avatar
Gamer
Tin Can
 

Join Date: Mar 2008
Location: Yes.
Posts: 33
NiallTL is on a distinguished road
Send a message via MSN to NiallTL Send a message via Skype™ to NiallTL
Default

Aw shoot.

I can get it to stop all the variables working on the character when the key is P, but I can't get them to start again when I press it again. Is there any way for it to detect a second keypress?
__________________
'Lo peoples. I'm NiallTL (Neel Tee Ehl).

Eh, I don't have to put effort into this, do I?
Reply With Quote
  #18  
Old 05-07-2008, 11:42 AM
Gaz's Avatar
Gaz Gaz is offline
Administrator
Power Drill
Better than 63.31% Better than 63.31% Better than 63.31%
 

Join Date: Jun 2007
Location: Ipswich, UK
Posts: 1,022
Gaz is a splendid one to beholdGaz is a splendid one to beholdGaz is a splendid one to beholdGaz is a splendid one to beholdGaz is a splendid one to beholdGaz is a splendid one to beholdGaz is a splendid one to beholdGaz is a splendid one to beholdGaz is a splendid one to behold
Default

Quote:
Originally Posted by NiallTL View Post
Aw shoot.

I can get it to stop all the variables working on the character when the key is P, but I can't get them to start again when I press it again. Is there any way for it to detect a second keypress?
Use the same method you detected the first with, if you've moved to a new frame remember to make sure the keypress detecting code/movieclip is there too.

This is one of those things that feels like it should be simple but can turn out to be a total pain depending on how you've coded the game. I don't think I've ever made a pause button
Reply With Quote
  #19  
Old 05-07-2008, 08:25 PM
NiallTL's Avatar
Gamer
Tin Can
 

Join Date: Mar 2008
Location: Yes.
Posts: 33
NiallTL is on a distinguished road
Send a message via MSN to NiallTL Send a message via Skype™ to NiallTL
Default

Nevermind, I think I've got it working. Thanks for the help.
__________________
'Lo peoples. I'm NiallTL (Neel Tee Ehl).

Eh, I don't have to put effort into this, do I?
Reply With Quote
  #20  
Old 05-07-2008, 10:37 PM
nàme's Avatar
Gamer
RoboRaptor
Better than 87.70% Better than 87.70% Better than 87.70%
 

Join Date: Aug 2007
Location: edmonton
Posts: 3,332
nàme is on a distinguished roadnàme is on a distinguished road
Default

now we test?
__________________
(\ (\
( ^_^)
(_(")(")
This is Bunny. Copy and paste bunny into your sig to help him gain world domination...
(\/)
(-_-)
(")(")
This is Bunny's friend. Copy and paste Bunny's friend for back-up...
/\_/\
( .. )
(")(")
This is robot-bunny. He will dominate everything who stands in Bunny's path...
|\_/| _______.
|^^|| ' |
|'') |'')
Bunny's bodyguard carries a gun everywhere he goes...
(\__/)
( O.o)
(> < ) Its a demented bunny...
(\(\ ~~ be a bunny ~~
(='.')~~ make war ~~
o(_")")~~ not luv ~~
Reply With Quote
Sponsored Links
Reply

Thread Tools
Display Modes

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
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT. The time now is 08:08 PM.


Powered by vBulletin® Version 3.7.2
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2007, Crawlability, Inc.

Ad Management by RedTyger