Powered by Invision Power Board

 
    Reply to this topicStart new topicStart Poll

> Does anybody here know actionscript, never mind fixed
United States
FailMan
Posted: Jul 13 2008, 12:31 PM
Quote Post


And I'd like to introduce you to the prime minister of engla
[*][*]

Group Icon
Group: Members
Posts: 650
Member No.: 3389
Joined: 2-March 07

Status: (0d) [--]


whenever I run ths code

QUOTE
onClipEvent(load){
   var falls:Number = 0;
   var jmpd:Boolean = false;
}
onClipEvent(enterFrame){
  if (Key.isDown(Key.RIGHT) && !Key.isDown(Key.LEFT)){
     _x+=5;
     xscale = 100;
}
   else if (Key.isDown(Key.LEFT) && !Key.isDown(Key.RIGHT)){
     _x-=5;
     xscale = -100;
}
   if(jmpd){
      falls += 0.5;
      _y += falls;
      if(this.hitTest(_root.ground)){
         jmpd = false;
      }
   }
   else{
      if(Key.isDown(Key.SPACE)){
         jmpd = true;
         falls = -10;
      }
   }
}
onClipEvent (enterFrame) {
if(_root.player.hitTest(_root.ground)){
  falls = 0;
  jmpd = false
}
}


My character moves around and jumps but after he jumps he just falls through the ground

This post has been edited by FailMan on Jul 13 2008, 01:57 PM


--------------------
Whatever.
PMEmail PosterAOL
Top
Unspecified
Draco Icebane
Posted: Jul 13 2008, 12:34 PM
Quote Post


Standard Member
[*][*][*][*][*]


Group Icon
Group: Banned
Posts: 52997
Member No.: 10
Joined: 13-October 03

Status: (71582612m) [XX]


I can figure out what this script means, at least.

The problem is that I have no idea how collision-detection is performed in Actionscript, so I can't figure out why the collision check is not working.

Also, even if this does work, your character will get stuck in the ground. I am sure Actionscript has While loops or For or something like that. Use those to make your character move a pixel at a time rapidly instead of several pixels at once.

I noticed that you changed the collision detection on the enter Frame event. What if you take the one on the bottom, with the root.player bullcrap, and replace the this. with it?

This post has been edited by Draco Icebane on Jul 13 2008, 12:35 PM
PM
Top
Canada
Mewizkuit
Posted: Jul 13 2008, 12:34 PM
Quote Post


CHARMANDER
[*][*][*][*]

Group Icon
Group: Members
Posts: 4397
Member No.: 2508
Joined: 16-August 06

Status: (0d) [--]


hehe your name is "FailMan".



--------------------
QUOTE
whenever i feel like clicking "reply"
i stop and think to myself, "why"
will it be a post to be remembered by?
or will i scare off a n00b and tell him to die?
PMEmail PosterMSN
Top
United States
M. Bison
Posted: Jul 13 2008, 12:37 PM
Quote Post


Standard Member
[*][*]

Group Icon
Group: Members
Posts: 2985
Member No.: 297
Joined: 25-February 04

Status: (0d) [--]


QUOTE (Dr. Light @ Jul 13 2008, 01:34 PM)
hehe your name is "FailMan".

Unless that's an insult, that's got NOTHING to do with his question.


--------------------
PM
Top
United States
FailMan
Posted: Jul 13 2008, 12:37 PM
Quote Post


And I'd like to introduce you to the prime minister of engla
[*][*]

Group Icon
Group: Members
Posts: 650
Member No.: 3389
Joined: 2-March 07

Status: (0d) [--]


QUOTE (Draco Icebane @ Jul 13 2008, 01:34 PM)
I can figure out what this script means, at least.

The problem is that I have no idea how collision-detection is performed in Actionscript, so I can't figure out why the collision check is not working.

Also, even if this does work, your character will get stuck in the ground. I am sure Actionscript has While loops or For or something like that. Use those to make your character move a pixel at a time rapidly instead of several pixels at once.

You know what is odd
You'd think I'd just be able to set the Vertical speed to 0

@dr. light
I'd be the lamest robot master


--------------------
Whatever.
PMEmail PosterAOL
Top
Canada
Mewizkuit
Posted: Jul 13 2008, 12:40 PM
Quote Post


CHARMANDER
[*][*][*][*]

Group Icon
Group: Members
Posts: 4397
Member No.: 2508
Joined: 16-August 06

Status: (0d) [--]


QUOTE (FailMan @ Jul 13 2008, 10:37 AM)
@dr. light
I'd be the lamest robot master

thats the best name ever.


--------------------
QUOTE
whenever i feel like clicking "reply"
i stop and think to myself, "why"
will it be a post to be remembered by?
or will i scare off a n00b and tell him to die?
PMEmail PosterMSN
Top
United States
FailMan
Posted: Jul 13 2008, 12:50 PM
Quote Post


And I'd like to introduce you to the prime minister of engla
[*][*]

Group Icon
Group: Members
Posts: 650
Member No.: 3389
Joined: 2-March 07

Status: (0d) [--]


QUOTE (Draco Icebane @ Jul 13 2008, 01:34 PM)
I noticed that you changed the collision detection on the enter Frame event. What if you take the one on the bottom, with the root.player bullcrap, and replace the this. with it?

and replace the what with root.play stuff


--------------------
Whatever.
PMEmail PosterAOL
Top
Unspecified
Draco Icebane
Posted: Jul 13 2008, 12:54 PM
Quote Post


Standard Member
[*][*][*][*][*]


Group Icon
Group: Banned
Posts: 52997
Member No.: 10
Joined: 13-October 03

Status: (71582612m) [XX]


QUOTE (FailMan @ Jul 13 2008, 10:50 AM)
and replace the what with root.play stuff

QUOTE
.rlysmall{font-size: 4px; line-height: 100%;}onClipEvent(load){  var falls:Number = 0;  var jmpd:Boolean = false;}onClipEvent(enterFrame){  if (Key.isDown(Key.RIGHT) && !Key.isDown(Key.LEFT)){    _x+=5;    xscale = 100;}  else if (Key.isDown(Key.LEFT) && !Key.isDown(Key.RIGHT)){    _x-=5;    xscale = -100;}  if(jmpd){      falls += 0.5;      _y += falls;      if(this.hitTest(_root.ground)){        jmpd = false;      }  }  else{      if(Key.isDown(Key.SPACE)){        jmpd = true;        falls = -10;      }  }}onClipEvent (enterFrame) {if(_root.player.hitTest(_root.ground)){  falls = 0;  jmpd = false}}
PM
Top
United States
FailMan
Posted: Jul 13 2008, 01:01 PM
Quote Post


And I'd like to introduce you to the prime minister of engla
[*][*]

Group Icon
Group: Members
Posts: 650
Member No.: 3389
Joined: 2-March 07

Status: (0d) [--]


nope
still goes through the ground


--------------------
Whatever.
PMEmail PosterAOL
Top
United States
FailMan
Posted: Jul 13 2008, 01:56 PM
Quote Post


And I'd like to introduce you to the prime minister of engla
[*][*]

Group Icon
Group: Members
Posts: 650
Member No.: 3389
Joined: 2-March 07

Status: (0d) [--]


fixed it
I forgot to give the floor an instance name in addition to a normal name


--------------------
Whatever.
PMEmail PosterAOL
Top
Spain
Sergeant DeeY
Posted: Jul 13 2008, 02:02 PM
Quote Post


~Heh Heh~
[*][*][*]

Group Icon
Group: Members
Posts: 1344
Member No.: 4730
Joined: 17-November 07

Status: (0d) [--]


This is GM of MMF


--------------------
The signature will not be available when the new forums shows up.
~~DeeY~~
PMUsers Website
Top
Unspecified
Draco Icebane
Posted: Jul 13 2008, 02:03 PM
Quote Post


Standard Member
[*][*][*][*][*]


Group Icon
Group: Banned
Posts: 52997
Member No.: 10
Joined: 13-October 03

Status: (71582612m) [XX]


QUOTE (Darkyoshi @ Jul 13 2008, 12:02 PM)
This is GM of MMF

ActionScript is Flash.
PM
Top
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

  Topic Options Topic Options Reply to this topicStart new topicStart Poll

 




[ Script Execution time: 0.0544 ]   [ 14 queries used ]   [ GZIP Enabled ]   [ Server Load: 0.41 ]