Forum Topic: Game AS2 help

(143 views • 17 replies)

This topic is 1 page long.

<< < > >>
Crying

l300l30

Reply To Post Reply & Quote

Posted at: 7/1/09 12:07 AM

l300l30 DARK LEVEL 05

Sign-Up: 08/18/07

Posts: 35

Hey im making a game right now ,

The problem is I don't know how to add an object that my character can walk into so that he can go to the next level .

can someone help me?

its ActionScript2.

Thanks.

hmm what to do now?...


None

Andy-Parker

Reply To Post Reply & Quote

Posted at: 7/1/09 12:12 AM

Andy-Parker DARK LEVEL 22

Sign-Up: 05/21/02

Posts: 1,162

probably just do

if ( character.hitTest(object) ){
gotoAndPlay(nextLevel);
}

change to suit your needs

I've covered wars, ya know.


None

nexusknight

Reply To Post Reply & Quote

Posted at: 7/1/09 12:21 AM

nexusknight LIGHT LEVEL 08

Sign-Up: 11/09/07

Posts: 114

At 7/1/09 12:12 AM, Andy-Parker wrote: probably just do

if ( character.hitTest(object) ){
gotoAndPlay(nextLevel);
}

change to suit your needs

Nice job just make your Object as MC( movie clip) then register top-right and put the code as shown in the forum as actions and your finished


None

l300l30

Reply To Post Reply & Quote

Posted at: 7/1/09 12:33 AM

l300l30 DARK LEVEL 05

Sign-Up: 08/18/07

Posts: 35

Thanks but it didn't work ,

This is the script

-----my char---------object he needs to touch.
-------V-------------------V---
if ( man.hitTest(Finish Point){
gotoAndStop(2);
}

did I do anything wrong?

hmm what to do now?...


None

l300l30

Reply To Post Reply & Quote

Posted at: 7/1/09 12:34 AM

l300l30 DARK LEVEL 05

Sign-Up: 08/18/07

Posts: 35

[IMG]http://i43.tinypic.com/k485dd.jpg[/
IMG]

hmm what to do now?...


None

Andy-Parker

Reply To Post Reply & Quote

Posted at: 7/1/09 01:50 AM

Andy-Parker DARK LEVEL 22

Sign-Up: 05/21/02

Posts: 1,162

At 7/1/09 12:33 AM, l300l30 wrote: Thanks but it didn't work ,

This is the script

-----my char---------object he needs to touch.
-------V-------------------V---
if ( man.hitTest(Finish Point){
gotoAndStop(2);
}

did I do anything wrong?

instance names cant have spaces in them.

I've covered wars, ya know.


None

l300l30

Reply To Post Reply & Quote

Posted at: 7/1/09 02:14 AM

l300l30 DARK LEVEL 05

Sign-Up: 08/18/07

Posts: 35

It still doesn't work

I changed the instance name to "finish"

and it still doesn't work...

character's instance name - "char"

point he needs to touch - "finish"

hmm what to do now?...


None

UnknownFury

Reply To Post Reply & Quote

Posted at: 7/1/09 02:21 AM

UnknownFury EVIL LEVEL 26

Sign-Up: 08/10/05

Posts: 6,031

You're missing a closing bracket. if ( man.hitTest(Finish Point))
And make sure it is in an enterFrame event, obviously.

Portfolio(Under construction): UnknownFury.com |
Msn: giant_ak_47@msn.com | Contact: me@unknownfury.com
Follow me on twitter!


None

l300l30

Reply To Post Reply & Quote

Posted at: 7/1/09 02:22 AM

l300l30 DARK LEVEL 05

Sign-Up: 08/18/07

Posts: 35

At 7/1/09 02:14 AM, l300l30 wrote: It still doesn't work

I changed the instance name to "finish"

and it still doesn't work...

character's instance name - "man"

point he needs to touch - "finish"

sorry the characters instance name is man

hmm what to do now?...


None

l300l30

Reply To Post Reply & Quote

Posted at: 7/1/09 02:27 AM

l300l30 DARK LEVEL 05

Sign-Up: 08/18/07

Posts: 35

At 7/1/09 02:21 AM, UnknownFury wrote: You're missing a closing bracket. if ( man.hitTest(Finish Point))
And make sure it is in an enterFrame event, obviously.

so like this?

enterFrame event{
if( man.hitTest(this) ){
gotoAndPlay(2);
} 
}

hmm what to do now?...


None

l300l30

Reply To Post Reply & Quote

Posted at: 7/1/09 02:28 AM

l300l30 DARK LEVEL 05

Sign-Up: 08/18/07

Posts: 35

if it is it still doesn't work

hmm what to do now?...


None

Andy-Parker

Reply To Post Reply & Quote

Posted at: 7/1/09 02:28 AM

Andy-Parker DARK LEVEL 22

Sign-Up: 05/21/02

Posts: 1,162

At 7/1/09 02:21 AM, UnknownFury wrote: And make sure it is in an enterFrame event, obviously.

indeed you cant forget that.

to summarise:

onEnterFrame = function(){ 
 if ( man.hitTest(finish) ){ 
  _root.gotoAndStop(2); 
//this will go to the second frame of the timeline, if you want the second frame of something else put somethingElse.gotoAndStop. if you want the second scene put in the name of that scene, _root.gotoAndStop("Scene 2",1);
 }
}

Make sure the instance name of your object and character are finish and man respectively.

I've covered wars, ya know.


None

UnknownFury

Reply To Post Reply & Quote

Posted at: 7/1/09 02:37 AM

UnknownFury EVIL LEVEL 26

Sign-Up: 08/10/05

Posts: 6,031

At 7/1/09 02:27 AM, l300l30 wrote: enterFrame event{
if( man.hitTest(this) ){
gotoAndPlay(2);
}
}

How about you actually learn? Read. And read the links at the bottom too.

Portfolio(Under construction): UnknownFury.com |
Msn: giant_ak_47@msn.com | Contact: me@unknownfury.com
Follow me on twitter!


Elated

l300l30

Reply To Post Reply & Quote

Posted at: 7/1/09 03:25 AM

l300l30 DARK LEVEL 05

Sign-Up: 08/18/07

Posts: 35

YAY thank you for all of your help everyone it works!!!

i can continue with my game now!!

hmm what to do now?...


None

4urentertainment

Reply To Post Reply & Quote

Posted at: 7/1/09 05:18 AM

4urentertainment NEUTRAL LEVEL 13

Sign-Up: 08/01/08

Posts: 1,534

At 7/1/09 03:25 AM, l300l30 wrote: YAY thank you for all of your help everyone it works!!!

i can continue with my game now!!

I suggest you learn the basics of actionscript before making a game. As well as brushing up on your syntax.

"When you look at yourself from a universal standpoint, something inside always reminds or informs you that there are bigger and better things to worry about. "- Einstein


None

l300l30

Reply To Post Reply & Quote

Posted at: 7/1/09 05:53 AM

l300l30 DARK LEVEL 05

Sign-Up: 08/18/07

Posts: 35

At 7/1/09 02:37 AM, UnknownFury wrote:
At 7/1/09 02:27 AM, l300l30 wrote: enterFrame event{
if( man.hitTest(this) ){
gotoAndPlay(2);
}
}
How about you actually learn? Read. And read the links at the bottom too.

sorry , Next time I need a code ill try and learn it myself I won't ask on the forum.

hmm what to do now?...


None

nexusknight

Reply To Post Reply & Quote

Posted at: 7/23/09 12:31 PM

nexusknight LIGHT LEVEL 08

Sign-Up: 11/09/07

Posts: 114

At 7/1/09 05:53 AM, l300l30 wrote:
At 7/1/09 02:37 AM, UnknownFury wrote:
At 7/1/09 02:27 AM, l300l30 wrote: enterFrame event{
if( man.hitTest(this) ){
gotoAndPlay(2);
}
}

sorry , Next time I need a code ill try and learn it myself I won't ask on the forum.

hahaha what a boob =]


None

4urentertainment

Reply To Post Reply & Quote

Posted at: 7/23/09 12:33 PM

4urentertainment NEUTRAL LEVEL 13

Sign-Up: 08/01/08

Posts: 1,534

At 7/23/09 12:31 PM, nexusknight wrote:
At 7/1/09 05:53 AM, l300l30 wrote:
At 7/1/09 02:37 AM, UnknownFury wrote:
At 7/1/09 02:27 AM, l300l30 wrote: enterFrame event{
if( man.hitTest(this) ){
gotoAndPlay(2);
}
}
sorry , Next time I need a code ill try and learn it myself I won't ask on the forum.

hahaha what a boob =]

...you just bumped a relatively old topic, where the problem is solved, just to post a random insult about the OP's flash skills, when you aren't any better yourself?

"When you look at yourself from a universal standpoint, something inside always reminds or informs you that there are bigger and better things to worry about. "- Einstein


All times are Eastern Standard Time (GMT -5) | Current Time: 05:43 AM

<< Back

This topic is 1 page long.

<< < > >>
You need a Grounds Gold Account to post on the NG BBS! If you don't have one, click here to sign up now! It's fast, free, and easy — and opens up tons of great NG features!