00:00
00:00
Newgrounds Background Image Theme

xo1029392 just joined the crew!

We need you on the team, too.

Support Newgrounds and get tons of perks for just $2.99!

Create a Free Account and then..

Become a Supporter!

Side-scroller problem

554 Views | 4 Replies
New Topic Respond to this Topic

Side-scroller problem 2008-06-02 22:07:56


Uhm, any help is needed.

Well, I'm working on a game, and this is how far I got. http://spamtheweb.com/ul/upload/020608/7 8740_firstlevel_04.php

The problem is that I can't think of a code that'll make the hero transport to the next section of the platform. At the edge is the end of the first section and when the hero interacts with the invisible wall, as she touches it, she should automatically go to the second part, which is on a different frame.

Just an example would help. Thanks in advance.


...

Response to Side-scroller problem 2008-06-02 22:13:05


onClipEvent(enterFrame){
	if (this.hitTest(_root.mcHero)==true){
		_global.heroX=50
		_global.heroY=64
		_root.gotoAndStop(framenumber)
	}
}

^Goes on the wall/floor/whatever sends hero to next frame.

Response to Side-scroller problem 2008-06-02 22:53:09


Forgot to mention that the x and y denotes where the hero will be on the next frame.

Response to Side-scroller problem 2008-06-02 23:03:33


At 6/2/08 10:13 PM, Cryoma wrote: onClipEvent(enterFrame){
if (this.hitTest(_root.mcHero)==true){
_global.heroX=50
_global.heroY=64
_root.gotoAndStop(framenumber)
}
}

^Goes on the wall/floor/whatever sends hero to next frame.

What does global mean in this case?


...

Response to Side-scroller problem 2008-06-02 23:05:20


Pretty much the same thing as _root I think.


Mibbygames.com

panterA

BBS Signature