ForumsProgramming ForumHow to make a next level {AS2}

26 11474
Dannydaninja
offline
Dannydaninja
948 posts
Nomad

Hi, i have a question. I'm using ActionScript 2.0 and i need to know how to make new rooms and how to make the Char go to the next room by contacting/ touching / colliding into a door. Thanks!

  • 26 Replies
AbnormalIdiot
offline
AbnormalIdiot
110 posts
Nomad

To make new rooms, just make several movieClips (1 for each room). Then when you touch a door, make the room you are in invisible and the one you are headed to visible. Colliding with a door:

if(this.hitTest(_root.door))
{
_root.room1._visible = false;
_root.room2._visible = true;
}

Dannydaninja
offline
Dannydaninja
948 posts
Nomad

Doesn't Work... Actaully can someone just tell me how to make a frame, and how to make the frame diffrent from the previous one!?

manny6574
offline
manny6574
922 posts
Nomad

new keyframe(not just frame) and do something different. delete the last one and draw something new???

maffegozer
offline
maffegozer
64 posts
Nomad

Abnormalldiot

Thanks alot.
You've helped me too!
I thought you'd need to use keyframes and gotoandstop/play things xD!

replace room1 and 2 with the name of the movieClip right?

alsage
offline
alsage
132 posts
Nomad

I have a lot easier one... doing the room visibility thing is nice but it takes a lot of work.....

MAKE SURE YOUR GUY IS ON ITS OWN LAYER


MAIN FRAME:

stop(); <- need this

if(yourguy.hitTest(_root.collisonitem))
{
gotoandplay (2);

yourguy._x = putNumberHere;
yourguy._y = putNumberHere;
}

now make a second frame:

goto actions of second frame and put this

stop();

and it should work

AbnormalIdiot
offline
AbnormalIdiot
110 posts
Nomad

But wouldn't you need that code (or something similar to it) on every frame? Wouldn't it be simpler to do a simple hitTest on the actions of each door:

if(this.hitTest(_root.character))
{
_parent._visible = false;
_root.room2._visible = true;
}

You can pretty much copy and paste this for each door, but with making a different room visible. You might also need to add something like _x -= 300 (or whatever the width of your stage is) or something like it with y or adding instead of subtracting.

alsage
offline
alsage
132 posts
Nomad

actually it wont matter but my dad is an expert programmer ad he said that is the best way

plasmafish
offline
plasmafish
252 posts
Nomad

actually it wont matter but my dad is an expert programmer ad he said that is the best way


Who is your dad? If he's so good, let us know who he works for and what makes him such an expert?

What languages is he an "expert" in?
alsage
offline
alsage
132 posts
Nomad

he programs in almost all languages VB, AS, c++, c#, C, lingo, java, and many others

plasmafish
offline
plasmafish
252 posts
Nomad

My point is that you said your dad "is" an expert and "he" recommended some amateurish code over abnormalidiots code which was much better.

Dannydaninja
offline
Dannydaninja
948 posts
Nomad

Thanks for all your help guys!!

Ummm... you guys give good advice and all but i have to admit that Alsage's way was a lot more simple and easier for an ametaur like me to understand.

I guess Alsage's dad IS an exspert programmer but gave Alsage an amatueur trick because Alsage is an amateur.

NOW ONLY ONE THING LEFT TO ASK ( I hope! )

How on earth do i make my character on his own Layer!? Because i tried Alsages trick, it was simple and all but it didn't work. i think the problem is that i didn't make my guy have his own Layer...


somone please answer i want to know all the code for this game so i can start making it!

AbnormalIdiot
offline
AbnormalIdiot
110 posts
Nomad

Right click on the layers in the timeline and select "insert layer"

alsage
offline
alsage
132 posts
Nomad

yep what abnormall said

tehQED
offline
tehQED
33 posts
Nomad

right click the object, and select 'distribute to layers'

AbnormalIdiot
offline
AbnormalIdiot
110 posts
Nomad

That separates the movieclip into several layers inside it. Right click on the main timeline (where it says layer 1 or whatever you named it) then click insert layer

Showing 1-15 of 26