Play free games online!


Go Back   The Game Homepage Forums > Development > Flash Development

Reply
 
LinkBack Thread Tools Display Modes
  #1  
Old 05-03-2008, 05:01 PM
NiallTL's Avatar
Gamer
Tin Can
 

Join Date: Mar 2008
Location: Yes.
Posts: 32
NiallTL is on a distinguished road
Send a message via MSN to NiallTL Send a message via Skype™ to NiallTL
Default I'm back! :D

Okay, new slight problem.
When you complete a level, I'd like it to display how much I scored on the 'level completed' frame.
I have a dynamic textbox with the var of score, I dunno if that could aid anything.
__________________
'Lo peoples. I'm NiallTL (Neel Tee Ehl).

Eh, I don't have to put effort into this, do I?

Last edited by NiallTL; 05-03-2008 at 07:24 PM.
Reply With Quote
  #2  
Old 05-03-2008, 05:10 PM
Gaz's Avatar
Gaz Gaz is offline
Administrator
Power Drill
Better than 63.48% Better than 63.48% Better than 63.48%
 

Join Date: Jun 2007
Location: Ipswich, UK
Posts: 1,018
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 behold
Default

Quote:
Originally Posted by NiallTL View Post
Hello again!
I'm making a game, hopefully this time it'll be a little more succesful

Anyways, to the point, I am having it so that when the character hits something the lives go down by one (already sorted that).
The problem is that I would like it so that when the lives (dynamic text with a var of lives) reaches 0, it to go to a specific frame (in this case, 16).
Just wondering where to put the code, and what the code in question is

Thanks.

The best place to put it is in the same place where you reduce the lives so instead of just having:

Code:
lives--;
You have:

Code:
lives--;
if (lives < 1) {
    gotoAndPlay(16);
}
or

Code:
lives--;
if (lives < 1) {
    _root.gotoAndPlay(16);
}
If it's the main timeline you want to go to frame 16

__________________
Gaz's Screenshot Tutorial | Add Games to TGH

My dog licks me every day. My friends say it is cute but I know better. It's tasting me, tasting me and counting down the days till it's big enough to eat me
Reply With Quote
  #3  
Old 05-03-2008, 07:25 PM
NiallTL's Avatar
Gamer
Tin Can
 

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

YES! Thanks so much, I managed to get it working now
Though lives--; didn't do it, I had to make it _root.lives--;

See, I have more knowledge now, Gaz!
Thanks again, you will be credited for help.

Sorry for double post, but new problem is here. Look up top.
__________________
'Lo peoples. I'm NiallTL (Neel Tee Ehl).

Eh, I don't have to put effort into this, do I?

Last edited by NiallTL; 05-03-2008 at 07:25 PM. Reason: Automerged Doublepost
Reply With Quote
  #4  
Old 05-03-2008, 08:18 PM
nàme's Avatar
Gamer
RoboRaptor
Better than 86.72% Better than 86.72% Better than 86.72%
 

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

double posts are automatically merged

and when can we test out this game?
__________________
(\ (\
( ^_^)
(_(")(")
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
  #5  
Old 05-03-2008, 11:07 PM
Gaz's Avatar
Gaz Gaz is offline
Administrator
Power Drill
Better than 63.48% Better than 63.48% Better than 63.48%
 

Join Date: Jun 2007
Location: Ipswich, UK
Posts: 1,018
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 behold
Default

Quote:
Originally Posted by NiallTL View Post
Okay, new slight problem.
When you complete a level, I'd like it to display how much I scored on the 'level completed' frame.
I have a dynamic textbox with the var of score, I dunno if that could aid anything.
If the dynamic text box has the var of the score it should show it, you've already solved the problem

Now just put a static text box above it that says something like "Level completed! You scored:"

+ your level complete screen is complete!
__________________
Gaz's Screenshot Tutorial | Add Games to TGH

My dog licks me every day. My friends say it is cute but I know better. It's tasting me, tasting me and counting down the days till it's big enough to eat me
Reply With Quote
  #6  
Old 05-04-2008, 01:02 PM
NiallTL's Avatar
Gamer
Tin Can
 

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

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.
__________________
'Lo peoples. I'm NiallTL (Neel Tee Ehl).

Eh, I don't have to put effort into this, do I?
Reply With Quote
  #7  
Old 05-04-2008, 01:36 PM
Shanepoo2's Avatar
Gamer
RoboSapien
Better than 95.48% Better than 95.48% Better than 95.48%
 
Join Date: Aug 2007
Location: over there ------->
Posts: 5,777
Shanepoo2 is a splendid one to beholdShanepoo2 is a splendid one to beholdShanepoo2 is a splendid one to beholdShanepoo2 is a splendid one to beholdShanepoo2 is a splendid one to beholdShanepoo2 is a splendid one to beholdShanepoo2 is a splendid one to beholdShanepoo2 is a splendid one to behold
Default

Lol. i'm gone. a tad too complicated..
__________________

Noah and the whale
- 5 years Time -
Reply With Quote
  #8  
Old 05-04-2008, 03:08 PM
NiallTL's Avatar
Gamer
Tin Can
 

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

Then wasn't that post kinda useless then? :/
__________________
'Lo peoples. I'm NiallTL (Neel Tee Ehl).

Eh, I don't have to put effort into this, do I?
Reply With Quote
  #9  
Old 05-04-2008, 04:24 PM
nàme's Avatar
Gamer
RoboRaptor
Better than 86.72% Better than 86.72% Better than 86.72%
 

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

when will we be able to 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
  #10  
Old 05-04-2008, 06:38 PM
NiallTL's Avatar
Gamer
Tin Can
 

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

I wanna get some of the key issues out of the way before you can test. You can test in a while.
__________________
'Lo peoples. I'm NiallTL (Neel Tee Ehl).

Eh, I don't have to put effort into this, do I?
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 04:49 PM.


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

Ad Management by RedTyger