Be a Supporter!

Side-scroller problem

  • 323 Views
  • 4 Replies
New Topic Respond to this Topic
Rule
Rule
  • Member since: Jan. 21, 2005
  • Offline.
Forum Stats
Member
Level 43
Blank Slate
Side-scroller problem Jun. 2nd, 2008 @ 10:07 PM Reply

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.


...

Cryoma
Cryoma
  • Member since: Dec. 18, 2007
  • Offline.
Forum Stats
Member
Level 15
Musician
Response to Side-scroller problem Jun. 2nd, 2008 @ 10:13 PM Reply

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.

Cryoma
Cryoma
  • Member since: Dec. 18, 2007
  • Offline.
Forum Stats
Member
Level 15
Musician
Response to Side-scroller problem Jun. 2nd, 2008 @ 10:53 PM Reply

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

Rule
Rule
  • Member since: Jan. 21, 2005
  • Offline.
Forum Stats
Member
Level 43
Blank Slate
Response to Side-scroller problem Jun. 2nd, 2008 @ 11:03 PM Reply

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?


...

Woadraiders
Woadraiders
  • Member since: Nov. 11, 2007
  • Offline.
Forum Stats
Member
Level 11
Blank Slate
Response to Side-scroller problem Jun. 2nd, 2008 @ 11:05 PM Reply

Pretty much the same thing as _root I think.


Mibbygames.com
panterA

BBS Signature