Be a Supporter!

Help on some actionscripts

  • 466 Views
  • 9 Replies
New Topic Respond to this Topic
SamIam
SamIam
  • Member since: Apr. 13, 2006
  • Offline.
Forum Stats
Member
Level 30
Animator
Help on some actionscripts 2007-02-01 21:55:55 Reply

OK I'm making a Zelda game and I'm having problems finding a hit test that works..> I have gone through teh AS Main and found one, but my character get stuck and stop before it hits the tree...

http://denvish.net/ulf/1170382090_linksprite.
php
this is the game
I spelled Kakariko...KoKarika because it will be a differnet village...

Need help on:
I need Hit tests for the Trees, rocks, and sign
and a Teleport hit test for the left path.... I put a symbol on the left path that teleports ou to the next frame but it doesn't work
onClipEvent (enterFrame) {
if (hitTest(_root.link)) {
gotoAndStop(2);
}
}

uyersuyer
uyersuyer
  • Member since: May. 15, 2002
  • Offline.
Forum Stats
Member
Level 05
Blank Slate
Response to Help on some actionscripts 2007-02-01 22:01:24 Reply

Oh wow.

Look it up a little better, kid. There's all kinds of tutorials on hitTest all over Google, and I'd suggest getting a basic grasp on the subject before trying any form of game.


"Whoever said 'winners never quit' obviously never considered addicts." - Hoeloe

BBS Signature
Lone-Ronin1
Lone-Ronin1
  • Member since: Dec. 8, 2005
  • Offline.
Forum Stats
Member
Level 11
Blank Slate
Response to Help on some actionscripts 2007-02-01 22:02:21 Reply

onClipEvent (enterFrame) {
if (hitTest(_root.link)) {
_root.gotoAndStop(2);
}
}

now that should work

Kart-Man
Kart-Man
  • Member since: Jan. 7, 2007
  • Offline.
Forum Stats
Member
Level 27
Blank Slate
Response to Help on some actionscripts 2007-02-01 22:04:05 Reply

onClipEvent (enterFrame) {
if (this.hitTest (_root.link)) {
_root.gotoAndStop (2);
}
}

I suggest reading up on Actionscript before attempting to make a game. hitTest is one of the basic examples of code you'll find.


postcount +=1;
Newgrounds Photoshop Headquarters || Don't use MS Paint! Use Aviary!
SING US A SING YOU'RE THE PIANO MAN

BBS Signature
uyersuyer
uyersuyer
  • Member since: May. 15, 2002
  • Offline.
Forum Stats
Member
Level 05
Blank Slate
Response to Help on some actionscripts 2007-02-01 22:06:05 Reply

You should probably make a standing frame for when Link isn't moving. It looks awkward having him run in place like that.


"Whoever said 'winners never quit' obviously never considered addicts." - Hoeloe

BBS Signature
Kart-Man
Kart-Man
  • Member since: Jan. 7, 2007
  • Offline.
Forum Stats
Member
Level 27
Blank Slate
Response to Help on some actionscripts 2007-02-01 22:09:03 Reply

At 2/1/07 10:06 PM, uyersuyer wrote: You should probably make a standing frame for when Link isn't moving. It looks awkward having him run in place like that.

He's jogging for his health. :)
Yeah, from a graphical standpoint, the game doesn't look so good. Link's downward running animation moves down when he runs, then loops back up suddenly.


postcount +=1;
Newgrounds Photoshop Headquarters || Don't use MS Paint! Use Aviary!
SING US A SING YOU'RE THE PIANO MAN

BBS Signature
kingofkofs
kingofkofs
  • Member since: Jan. 29, 2007
  • Offline.
Forum Stats
Member
Level 02
Blank Slate
Response to Help on some actionscripts 2007-02-01 22:11:49 Reply

onClipEvent (enterFrame) {
if(_root.bianliang==0){
if(Key.isDown("xxx"){
_root.girl._x..................
..............................

onClipEvent (enterFrame) {
if(_root.girl.hitTest.(_root.tree)){
_root.bianliang=1
}else{
_root.bianliang=0
}
}

give root a Variable txt ,name bianliang
sorry English is not good

SamIam
SamIam
  • Member since: Apr. 13, 2006
  • Offline.
Forum Stats
Member
Level 30
Animator
Response to Help on some actionscripts 2007-02-01 22:23:19 Reply

Thanks Kart-Man and Lone-Ronin1.....it worked

At 2/1/07 10:06 PM, uyersuyer wrote: You should probably make a standing frame for when Link isn't moving. It looks awkward having him run in place like that.

I have one, but when I enter it in. Links Animations would just stop...He would still face right if you go right but it will look like he is sliding across the stage!

uyersuyer
uyersuyer
  • Member since: May. 15, 2002
  • Offline.
Forum Stats
Member
Level 05
Blank Slate
Response to Help on some actionscripts 2007-02-01 22:43:07 Reply

At 2/1/07 10:23 PM, Hylian-Mafia wrote: Thanks Kart-Man and Lone-Ronin1.....it worked

At 2/1/07 10:06 PM, uyersuyer wrote: You should probably make a standing frame for when Link isn't moving. It looks awkward having him run in place like that.
I have one, but when I enter it in. Links Animations would just stop...He would still face right if you go right but it will look like he is sliding across the stage!

You need to set your code so that it goes to the a different frame of the movieclip whenever you want him to move and then go back when he's standing still.


"Whoever said 'winners never quit' obviously never considered addicts." - Hoeloe

BBS Signature
kingofkofs
kingofkofs
  • Member since: Jan. 29, 2007
  • Offline.
Forum Stats
Member
Level 02
Blank Slate
Response to Help on some actionscripts 2007-02-01 23:56:53 Reply

you mean like this

http://kingofkofss.xinwen365.com/sszy.swf