Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
  Advanced Search
  HOME    TRACKER    Flash




Platform



Greetings, I have went through the platform tutorial, I have tried it and I find it very interesting. I'm doing a few tests to it, and i am wondering, how can you create blocks in the air that you can hit, that won't allow the ball to pass through it, so when you hit it you bounce back down the the ground? Any coding advice will be greatly appreciated! (I use Flash 8) Thank you.



KirupaForum > Flash > ActionScript 1.0/2.0
Posted on: 02-17-2006, 03:29 PM


View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread

Platform Help
What should i put on platform?


Here is the jumping code to help!

onClipEvent (load) {
maxfall = 15;
gravity = 2.5;
jump = -15;
}
onClipEvent (keyDown) {
if (Key.isDown(32) && !jumping) {
maxfall = 15;
gravity = 2.5;
jump_height = -9;
jumping = true;
}
}
onClipEvent (enterFrame) {
if (jumping) {
_root.kilik._y += jump_height;
if (push_timer<6 && jump_height == -10 && Key.isDown(Key.UP)) {
push_timer++;
} else {
jump_height++;
}
if (jump_height == 10) {
push_timer = 0;
jumping = false;
}
}
}

(instance name of player is "kilik")

Platform
How an I make a platform?

I mean, I have a charectar and I want it to stand on a ground. How can I do it?

[F8] Platform Help
Hello, I'm having a little bit of a platform problem. For me it is always the simplest things that stump me. lol
At the moment I have a movie clip of one platform which is vertically the length of the entire movie. Now there is multiple key frames within the movie clip which have different platforms in them. Each key frame has a stop(); in it. Now I can get each platform to come out one after another, every time the platform leaves the movie, but how do I make it so each platform come in all touching each other. So just show me how you would write the code for platforms coming out in order that touch each other, hopefully using the frame method that I am.

[CS3] Help Please Platform Help
hi, in a platform game im making, theres a bit where you jump on a moving platform, but when you do that, it moves without you, what script would i use to make it move your player as well?

Help With Platform Game
I'm making a platform game, but i'm stuck with coding.

1. i don't know how to make an action for 2 keys:

i want to make when you hit LEFT or RIGHT + CTRL

2. I want to make my character jump by pressing SPACE + LEFT or RIGHT

3. I don't know how to make my hero jump to a higher or lower platform and make it fall when you miss a platform.

Please help me, cause i can't figure it out.

Thanks,

Tha DraX

PS: I'm using flash 4, but i will use flash 5 if it can't be done with flash 4.

Platform Detection Possible?
Hello...........need some help on this one...
I have a projector file that I use to link to external programs. I would like to figure out a way though for Windows 95 users to be directed to a certain scene or movie and other Windows users somewhere else. Does anyone know if this is possible? I know it would be more likely within an HTML page, but I need it to work in the projector format. Any suggestions greatly appreciated. Tanx!

RC

*Please Help -platform Detection
i need to know if you can detect wich platform the user has and open a pop up window accordingly off of a button in a flash movie.

Cross Platform Cd's
I'm attempting to burn a cd for pc's and mac's. I'm using a program called CD Anywhere to burn the cross platformable CD. I have a flash movie that autostarts, which works on both machines. Problem is that when the movie hits the "get URL" action I get a "can't find file" message on the macs. Right now the get URL action is ../startshot/startshot.html. I can successfully put two different versions of the movie on the cd and each autstarts right now. I just need some help on how to change the action for the macs. Thanks.

Mac -windows Platform
I have created a flash navigation menu and a I use frames When I test the site in windows explorer all things working fine.
When I test the site in macintosh browser and a puch the navigation button the computer opens a "page not found" page. How cane I fix this problem. I use the following actioncode to activate the button. :
on (release) {
getURL (voorstelling.html, mainFrame);
}

Platform Game....help
ok, im sorta a flash newbie, and the tutorials on this site dont gimme tutorials on how to make a platform game... i've made a dress-up game before so im not a COMPLETE newb, but i need help. if u got a site that teaches u how to i'd be grateful

Platform Problem
OK. I have a problem with my platforms in a platform-esque game i am making. When you jump under the platform you can get to the top. I want it so that if you jump under the platform it keeps you from getting to the top and keeps you down.

here is my script:
---------------------------------
onClipEvent (enterFrame){
m_bounds=new Object();
m_bounds=this.getBounds(_root);

if ( hitTest (_root.hero) ){
if ( _root.hero.b_edge <= m_bounds.Xmax){

_root.hero._y=m_bounds.Ymax-16;


_root.hero.platform="on";}



}


}
-------------------------------------------
thanks

Platform Gaming
I did have a great example of a platform game, but thing is it ****ed up whenever u made a new frame and put the tiles in, so someone please tell me where i can get some example for a platform game, scrolling background(sonic, mario etc.) or if it isnt scrolling it doesnt matter, just where i can make teh character have moves and i can have a tile set.

(btw i did have another user, but i wasnt able to post anything, thats why ive only registerd today, never botherd with this forum before, and ive had flash for 2 years )

Help With Platform Game
Hi,
Im making a platform game, and im using the source that I put with this post. My problem is that I want to place the platforms inside a movieclip. But when I do that the hero cant stand on them. Can you tell me what code I should change...?
plz help me..., tnx

Help With Platform Game
Hi,
Im making a platform game, and im using the source that I put with this post. My problem is that I want to place the platforms inside a movieclip. But when I do that the hero cant stand on them. Can you tell me what code I should change...?
plz help me..., tnx

Cross Platform
I can't open a PC flash file on a Macintosh.
Does anybody know a way???????

MAC Platform Problem
I cant test my site on a mac, but my clients having problems with the thumbnails on this site : http://www.graemerobinson.com . Each dot is a duplicated movieclip, and each respective dot has a onrollover event ,calling loadmovie()- a jpeg off server - into its respective child MC. My client says that when he rolls over 1 dot, all thethumbnails show up!!! arg!!! if you have a mac pleez tell me what you see - andwhat browser/flash ver you're using..or if you have any clues about whats going wrong??

code for onrollover of dot :

on (rollOver) {
//get image dynamcally from the timeline above this
Img = eval("../:imageFile");
this.goToAndStop(2);
trace(Img);
//load it into thumb MC
loadMovie(Img, "../thumb");
}

Autorun 4 Any Platform?
Heres a simple one for you lot out there....

I just finished making a projector file in Flash.

To be precise published as a:

Windows Projector (exe)
Macintosh Projector

I want the project im working on to run on both platforms, my problem is getting them to autorun on either pc or mac. If anyone out there could tell me how to get both the Windows Projector (exe) AND Macintosh Projector to autorun, regardless of the type system its put in. Im a little confused with the file type the macintosh projector is

[autorun]
open=Main Menu Projector
icon=run.dll,5

??????Is something like this right....Any help would be good, thanks

Platform Game
is this the place to post this?
neways,I am new here and is 50-50 when it comes to actionscript and how do i make a game so that when the character(for example mario)mario moves to the side the backround moves to the side with him.i have checked many many places and so i posted here thnx 4 ur time



happy valentines day!!

Platform Game
If anyone knows a good tutorial on making a game like mario or could help me with platforms in a game like mario, that would be great.

Thanks

Cross Platform PC Vs. MAC
I’m sure this is a stupid question. At work I work on a PC and have the Macromedia Professional bundle that includes both Flash and Dreamweaver MX along with other applications. At home I work on a G4 Mac and have Dreamweaver and Flash 5. I am considering upgrading to MX at home but don’t really have the money right now. Is Macromedia’s software cross platform so I can take my files from my home G4 to my work PC and back again with out a problem? Or can I assume that I can only work on work files at work on the PC?

Platform Game
I need help in the backgrounds of my game, what im trying to do is to scroll the background when the sprite is at half of the screen. Im making a racing game, so i would want to have a scrolling background, so it appears to move as my car moves. Also if anyone knows how to create random cars that would help too. Thanks

OS/Platform Sniffer
Is it possible to use actionscript to detect the OS platform that a user has? specifically i want to know if the user is using a mac or a pc. if there is not a way to do this within the flash module, is there some simple javascript function that can do this? and if so, whats the easiest way to pass this variable into flash?

cheers

Platform/hittest
my fall speed is 15 and I tried
[code] onClipEvent (enterFrame) { if (this.hitTest(_root.Wall3)) {this. y+16}}[/code

Wall3 is my platforms name. I slow down a little but I don't stop.

Platform Game
Hi, I'm trying to modify a platform game that I found on the web.

Whenever the hero lands on a platform, I want a movieclip to play from my library. So when the hero lands on the first platform a movieclip from the library would play, then when the hero lands on the second platform, a different movieclip would play, and so on.

I've almost got it working for the first platform by using this code on the hero movieclip:

onClipEvent (enterFrame) {
if (this.hitTest(_root.platform)) {
_root.funFactHolder.attachMovie("funFact1","newIns tanceName", _root.getNextHighestDepth());
}
}


But when I use this code, the movieclip "funFact1" only plays when I move the hero off of the platform, I want it to play when the hero first lands on the platform. Then, I'm not sure how to make the second movieclip play when the hero lands on the second platform.

I'm in a real mess here, and I'm not too hot with actionscript.

Can anyone offer me any advice?

Thanks in advance.

Platform Game - Uh, Help.
Hey Everyone,
I've been wrestling with this platform game that I'm trying to get going. I'm stuck yet again.

I have a movieclip that plays when the hero lands on a particular platform. I'm using this code on the platform to detect if the hero lands on it:

onClipEvent (load) {
var shouldPlay:Boolean = true;
}
onClipEvent (enterFrame) {
if (this.hitTest(_root.player)) {
if (shouldPlay) {
_root.holderSixFive.attachMovie("funFactSixFive"," newInstanceName", _root.getNextHighestDepth());
shouldPlay = false;

}
} else {
shouldPlay = true;
}
}


Now, is there a way to make this movieclip stop playing when the hero leaves the platform?

So it only plays while he's standing on it, when he leaves, the movieclip stops, so a person doesn't have to watch the whole movieclip if they want to continue playing the game.

As always, thanks for everyone's help.

Platform Hit Test
im trying to make a platform game. I cant get an object to detect its touching another one. im trying to use this to detect that the character has touched the ground movie clip, which in turn will tell him to stop falling:

if (_root.ground.hitTest(this._x, this._y, true))

But it doesnt do anything. He falls right through it. What am I doing wrong?

Platform Game
how can i make view moves with player? in platform game

Platform Game Help
I took the original game from Kirupa and edited it to be like the Gameboy version of Legend of Zelda as best as I could, but I can't figure out how to make my hero not fall unless I put a hole in the map, and how to make it so that when I would move him up and down the screen follows him instead of just going left to right. Also how to make him move up and down without falling or jumping.
Also, how would I make a score variable that I can edit during the game from pickups and such and can be accessed later on a different frame?

Can someone please help me with those?

Platform Game Help.
i made a little circle guy move with the arrow keys, but i want to incorporate a floor, and gravity so he actually jumps and doesnt just fly, id like to have obstacles for him to jump over as well as platforms to jump to, but for that i need to know how to make him fall , i think i need hit tests, here is my current code, (this is the only code i can actually write so far i am very new to this) could someone please tell me what i need to add and explain how and why.....?

[F8] Platform Game
I'm going crazy!

This is my first attempt at a tile-based platform game, and I've only been at it for a few days now so it looks pretty bad. The thing is, I've been trying to add moving blocks and extra bad guys, but everything keeps going wonky. The bad guys will show up where I want them to, but when they hit a wall going left they stop altogether. And I have moving blocks, but I can't get more to show up without looking all crazy.

Here's the swf
Here's the fla

Any help from anyone who knows what they're doing would be infintely appreciated.

[F8] Platform Game Help?
I was checking out baz_productions tutorial, "Creating a simple Platform game", and used his code to try and make the character I had developed stand on the platforms I had created.

However, I can't figure out how to make his feet designate whether he's on the platform or not. The top of the clip is what's holding on to the platform, which is definitely not what I'm looking for.

Any help? Here's my code:

Code applied to the character:

Code:
onClipEvent (load) {
gravity = 10;
scale = _xscale;
walkSpeed = 6;
maxjump = 6;
}
onClipEvent (enterFrame) {
if (air == true) {
_y += gravity;
state = 3;
}
if (Key.isDown(Key.LEFT) && !_root.leftbound.hitTest(_x, _y, true)) {
_x -= walkSpeed;
_xscale = -scale;
}
if (Key.isDown(Key.RIGHT) && !_root.rightbound.hitTest(_x, _y, true)) {
_x += walkSpeed;
_xscale = scale;
}
if (_root.platforms.hitTest(_x, _y, true)) {
air = false;
} else {
air = true;
}
if (Key.isDown(Key.SPACE) && jump == true) {
_y -= jumpSpeed;
}
if (air == false) {
jump = true;
jumpcount = 0;
jumpSpeed = 22;
}
if (Key.isDown(Key.SPACE)) {
jumpcount += 1;
}
if (jumpcount>maxjump && jumpSpeed>-2) {
jumpSpeed -= 2;
}
if (air == false && !Key.isDown(Key.LEFT) && !Key.isDown(65) && _currentframe<4 or air == false && !Key.isDown(Key.RIGHT) && !Key.isDown(65) && _currentframe<4 or air == false && !Key.isDown(Key.CONTROL) && !Key.isDown(65) && _currentframe<5) {
state = 1;
walkSpeed = 6;
}
if (Key.isDown(Key.LEFT) && air == false && !Key.isDown(65) && _currentframe<4 or Key.isDown(Key.RIGHT) && air == false && !Key.isDown(65) && _currentframe<4) {
state = 2;
walkSpeed = 6;
}
if (Key.isDown(Key.CONTROL) && air == false && !Key.isDown(65) && _currentframe<4) {
state = 4;
walkSpeed = 12;
}
if (!Key.isDown(65)) {
gotoAndStop(state);
}
_root.statetxt = state;
}
onClipEvent (keyUp) {
if (Key.getCode() == 83) {
jump = false;
}
}




And here's the code on the platforms:

Code:
onClipEvent (enterFrame) {
if (_root.deathTrap.hitTest(_x,_y,true)) {
gotoAndStop(deathFrame);
}
}

[F8] Platform Game Help
I'm making a Platform game and I'm having trouble with it.
The character is always in the wrong position at the wrong time. also im not too sure how to make the guy run. I have the running MC in the Game though


Any help would be appreciated

[MX] Scrolling Platform
Ok, this question is a cross of actionscript and general flash...

How do you create a scrolling game, where the background changes, the character moves, and interacts with the environment? But you can still access menus that change...

for example: totally not trying to copy their idea or game type, but the scrolling, + menu thing

Frank's Adventure.

You can unlock things, while roaming the entire city, without any particular order...

can someone please explain how to set something like this up?????

[MX] Scrolling Platform
Ok, this question is a cross of actionscript and general flash...

How do you create a scrolling game, where the background changes, the character moves, and interacts with the environment? But you can still access menus that change...

for example: totally not trying to copy their idea or game type, but the scrolling, + menu thing

Frank's Adventure.

You can unlock things, while roaming the entire city, without any particular order...

can someone please explain how to set something like this up?????

Platform Scrolling
Currently I've recently completed a tutorial for making a platform game in action script 3.
The tutorial however only covers how to scroll the screen to the right. I was thinking of using this example and expanding upon it. So my question is how would I go about making it scroll up and down as well as left and right.

Currently the code provided
Hero= Movie clip Simple movie clip with different animation to move around the level.
Game level = Movie clip. Each Game Level is on each frame.
edgedistance is the static const so the screen knows to move left or right with that many pixels left to go.

public function scrollWithHero() {
var stagePosition:Number = gamelevel.x+hero.mc.x;
var rightEdge:Number = stage.stageWidth-edgeDistance;
var leftEdge:Number = edgeDistance;
if (stagePosition > rightEdge) {
gamelevel.x -= (stagePosition-rightEdge);
if (gamelevel.x < -(gamelevel.width-stage.stageWidth)) gamelevel.x = -(gamelevel.width-stage.stageWidth);
}
if (stagePosition < leftEdge) {
gamelevel.x += (leftEdge-stagePosition);
if (gamelevel.x > 0) gamelevel.x = 0;
}


So for a vertical position I would just need to replace the x's with y's and make a static const for roof distance?


var stagePosition:Number = gamelevel.y+hero.mc.y;
var rightUEdge:Number = stage.stageHeight+roofDistance;
var leftUEdge:Number = roofDistance;
if (stagePosition > rightUEdge) {
gamelevel.y = (stagePosition+rightUEdge);
if (gamelevel.y < +(gamelevel.height+stage.stageHeight)) gamelevel.y = +(gamelevel.height+stage.stageHeight);


}

if (stagePosition < leftUEdge) {
gamelevel.y += (leftUEdge+stagePosition);
if (gamelevel.y > 0) gamelevel.y = 0;
}
}

The screen does scroll up in this instance but only if I go downwards. Your thoughts?

Platform Game - How Do I's
Hi,
Im about to embark on writing some sort of platform game but have run in to a couple of 'issues'.

Im going to build the map up from tiles. Each tile will be either a platform, wall, backgound etc and my main character will need to detect collision with these. There will also be AI baddies that will need to do the same, all these will be shooting each other so the bullets need to detect collisions with all these other objects and walls etc.

So i am just wondering how you do this, short of a big collision detecting routine for each object vs each object which i dont imagine will be too efficient.

Any help or ideas appreciated

Hambo

Platform Game
Hello,
swf.= http://img131.imageshack.us/my.php?image=itworks5rz.swf
use control shift and enter to make him attack
version = MX 2004
I would like = The man to attack with a click of the mouse, not of a puch of control
Problem = I don't know how to do this, and, I cannot find any tutorials on how
Problem 2 = I don't know how to make him continue attacking even if you let go of a button (see this when holding down enter)
Solution = ?


code =


Code:
onClipEvent(load) {
moveSpeed = 10;
scale = _xscale
}
onClipEvent(enterFrame) {
if(Key.isDown(Key.RIGHT)) {
this._x += moveSpeed;
_xscale = scale;
}else if(Key.isDown(Key.LEFT)) {
this._x -= moveSpeed;
_xscale = -scale;
}
}
onClipEvent(enterFrame) {
if(Key.isDown(Key.UP) && !jumping && _root.platform.hitTest(this._x, this._y+35, true)) {
vel_y = 40;
jumping = true;
this.gotoAndStop(3);
}
if(jumping == true) {
vel_y -= 2;
this._y -= vel_y;
}
if(_root.platform.hitTest(this._x, this._y+35, true)) {
vel_y = 0;
jumping = false;
idle = true;
}
if(Key.isDown(Key.RIGHT) && _root.platform.hitTest(this._x, this._y+35, true)) {
this.gotoAndStop(2);
}
if(Key.isDown(Key.LEFT) && _root.platform.hitTest(this._x, this._y+35, true)) {
this.gotoAndStop(2);
}
if(idle == true && !Key.isDown(Key.LEFT) && !Key.isDown(Key.RIGHT) && !Key.isDown(Key.CONTROL) && !Key.isDown(Key.SHIFT) && !Key.isDown(Key.ENTER)) {
this.gotoAndStop(1);
time = 0
}
if(Key.isDown(Key.CONTROL) && !Key.isDown(Key.SHIFT) && !Key.isDown(Key.ENTER) && jumping == false) {
time += 0.02
lunge = (40+(-500*time))
if(lunge <= 0) {
lunge = 0;
}
this._x += lunge*(_xscale/100)
this.gotoAndStop(4);
}

if(Key.isDown(Key.SHIFT) && !Key.isDown(Key.CONTROL) && !Key.isDown(Key.ENTER) && jumping == false) {
time += 0.02
lunge = (60+(-500*time))
if(lunge <= 0) {
lunge = 0;
}
this._x += lunge*(_xscale/100)
this.gotoAndStop(5);
}

if(Key.isDown(Key.ENTER) && !Key.isDown(Key.CONTROL) && jumping == false) {
this.gotoAndStop(6);
}

if(Key.isDown(Key.UP) && !Key.isDown(Key.RIGHT) && !Key.isDown(Key.LEFT)){
this.gotoAndStop(3)
}
}
onClipEvent(enterFrame) {
this._y += 16;
if(_root.platform.hitTest(this._x, this._y+1, true)) {
this._y -= 16;
}

}

Can you help?

Cross Platform CD
hello all,
I am trying to make a cross platform autorun CD for mac and PC
using Director mx2004 i made two project one for window(.exe) and for mac(.osx from hqx )

i used CDEverywhere to make it autorun and then burned the CD .. the CD works perfectlly fine on windows but when i run cd on mac some of the files like .osx and .swf and some xml files are converted to text files format..

please can some one put light on my such problem

Platform Problems
I am currently producing a portfolio for my year 12 media course, and I am doing it all in flash. I wanted to do something unique, so I decided to make the interface a 2D platform game, so you control the character to go to different areas to look at different information.

I have everything down pat for the platform coding apart from one thing, the left and right boundaries do not work 100%. If you are running directly into a boundry, and jump, to get over it, such as a box, everything will move slightly to the left or right. It depends on whish way your running. It means all the boundries do not line up with the sprites so the guy will seem to float in mid air, or starts running and hits an invisble boundary that should be a few pixels to the left.

I have seen heaps of flash platform games that don't seem to use left right boundaries, the environment isn't flat... like fancy pants.

How could I...
a) stop the problem with the moving boundaries
or
b) make the platforms so that it works like fancy pants, or sonic and such

thanks for reading
Sephbin

Platform Game Help
Hello everyone,

I've been around this forum for a while and have learned a lot from here. Nowadays I am creating games - at least trying to develop games with flash. I'm working on a platform game. But I have a problem figuring something out here.. I have made my character move from left to right, jump, gravity is working fine and it does get the ground<>character collision, but as the ground goes up, the character stays on the same _Y height coordination. Let me try to explain what I mean;

The sprite is the ball;
http://project-midori.com/actionscri...ms/example.JPG
The ball's _Y coordination should go up as it walks up the ground..

I've seen an example of someone who made this game succeeding in what I am trying to accomplish for quite some time.. >_<
http://www.newgrounds.com/portal/view/355647

Can anybody please explain me how this could be done, or point me to someone who does know?
I've looked all over Google, but non of the tutorials that I have found so far explain this..

Thanks in advance!

P.S. I tried looking for a Game Section, but couldn't find one, I hope I did not post this in the wrong section, wouldn't want to screw up on my first post.. >_>

Platform Jumping Help
As you can tell (or maybe you can't) im new to action script and whenever I try my code to make him jump onto platforms he can jump on them but never off... can anyone edit my code please? Or just giving me their own code to make a platform jumper would be great!!! Any help is appreciated although the best was you could help me is to send any platformer fla. files you have to my email jmclune@gmail.com. PS: It's for Flash MX 2004.

Here's my code.

Character Code:

onClipEvent (load) {
y_start = _y;
jumping = false;
jumpspeed = 0;
}
onClipEvent (enterFrame) {
if (jumping) {
_y += jumpspeed;
jumpspeed += 1;
if (_y>=y_start) {
_y = y_start;
}
}
else {
if (Key.isDown(Key.SPACE)) {
jumping = true;
jumpspeed = -14;
}
}
}

Background Code (Attempt #1):

onClipEvent(enterFrame){
if(this.hitTest(_root.man)){
_root.man._y -= 5;
}
}
onClipEvent(enterFrame){
if(this.hitTest(_root.man)){
_root.man.jumping = false;
}
}

Thanks for the help! (If you give it...)

Cross Platform Cd Rom
Does anyone have any info on creating a cross-platform CD rom?

tutorials links etc?

Cheers

JP

Platform Game Help....
Well, I've got this code here for my character. It's instance name is 'circle', though the character itself is animated, that's just to keep it simple.

PHP Code:



onClipEvent (load) {
     fall = false;
     _name = "circle";
     jump = 0;
     speed = 6;
     jumpheight = 11;
     maxfall = -54;
}
onClipEvent (enterFrame) {
     xmin = getBounds(_root).xMin;
     xmax = getBounds(_root).xMax;
     ymin = getBounds(_root).yMin;
     ymax = getBounds(_root).yMax;
     if (Key.isDown(Key.SPACE) && fall == false && jump == undefined) {
          fall = true;
          jump = jumpheight;
     }
     if (jump<>undefined) {
          if (jump>maxfall) {
               jump--;
          }
          _y -= jump;
     }
}
onClipEvent (enterFrame) {
     if (Key.isDown(Key.LEFT)) {
          _x -= speed;
          if(_xscale==100){_xscale=-100;}
     }
     if (Key.isDown(Key.RIGHT)) {
          _x += speed;
          if(_xscale==-100){_xscale=100;}
     }





Now, this makes the character land on a platform and turn around fine, though my characters movie clip is one frame long, and therefore animated within itself(you know, when you double click). And the character keeps walking no matter what button you press(or don't press). So I need a code to make the character stop walking when no buttons are pressed.
Thanks.

PS. The platform code I have is this:

PHP Code:



onClipEvent (load) {
     activated = false;
     down = false;
}
onClipEvent (enterFrame) {
     _root.report.text = Math.round(_root.circle.yMax)+" "+Math.round(yMin);
     xmin = getBounds(_root).xMin;
     xmax = getBounds(_root).xMax;
     ymin = getBounds(_root).yMin;
     ymax = getBounds(_root).yMax;
     if (_root.circle.xMax>xMin && _root.circle.xMin<xMax && _root.circle.yMax<yMin) {
          if (_root.circle.yMax-_root.circle.jump*2>yMin) {
               _root.circle._y = ymin-_root.circle._height/2;
               _root.circle.jump = undefined;
               _root.circle.fall = false;
               activated = true;
          }
     }
     if (Math.round(_root.circle.yMax)>Math.round(yMin)) {
          if (hitTest(_root.circle) && _root.circle.xmax<xmin) {
               _root.circle._x -= _root.circle.speed;
          }
          if (hitTest(_root.circle) && _root.circle.xmin>xmax) {
               _root.circle._x += _root.circle.speed;
          }
          if (hitTest(_root.circle) && _root.circle.ymin>ymax && _root.circle.jump>-1) {
               _root.circle.jump = -1*(_root.circle.jump);
          }
     }
     if (activated == true && not hitTest(_root.circle) && _root.circle.jump == undefined) {
          _root.circle.jump = 0;
          activated = false;
     }
     if (hitTest(_root.circle) && _root.circle.ymax>ymin && _root.circle.jump<>undefined && _root.circle._y<_y) {
          _root.circle._y = ymin-_root.circle._height/2;
          _root.circle.jump = undefined;
          _root.circle.fall = false;
          activated = true;
     }
     if (_root.circle.ymax-_root.circle.jump>ymin && _root.circle.xMin<xMax && _root.circle.xMax>xMin && _root.circle.jump<>undefined && _root.circle._y<_y) {
          _root.circle._y = ymin-_root.circle._height/2;
          _root.circle.jump = undefined;
          _root.circle.fall = false;
          activated = true;
     }





Maybe that can help......

Platform Game
Hello people. I'm trying to build a simple game: a platform (a kind of) and I want my character to move on the terrain which is not completely flat. It has smooth bumps. (something like this http://www.pyramid-games.com/bud/screenshot_01.jpg just to get an idea). Now here is my problem: When the character is on a bump i'd like to see changing his orientation according to the normal at that position.
For instance if he's at the beginning of a hill, he should change his orientation to 40 degrees which turn to 0 as he moves to the top of the hill.
I was almost forgetting that the terrain is just a shape drawn within flash converted to movieclip.

Any help vould be appreciated.

Sorry, Your Platform Is Not Supported?
I'm trying to install the NBA Broadband package on my laptop. It's a package that allows me to view all the NBA games online. They say they require the latest Flash and when I click the link they provide it takes me to the Adobe Flash page where it says "Sorry, your platform is not supported."

Does anybody know what is going on here/

Thank you very much for the help!

Platform Scrolling
Currently I've recently completed a tutorial for making a platform game in action script 3.
The tutorial however only covers how to scroll the screen to the right. I was thinking of using this example and expanding upon it. So my question is how would I go about making it scroll up and down as well as left and right.

Currently the code provided
Hero= Movie clip Simple movie clip with different animation to move around the level.
Game level = Movie clip. Each Game Level is on each frame.
edgedistance is the static const so the screen knows to move left or right with that many pixels left to go.

public function scrollWithHero() {
var stagePosition:Number = gamelevel.x+hero.mc.x;
var rightEdge:Number = stage.stageWidth-edgeDistance;
var leftEdge:Number = edgeDistance;
if (stagePosition > rightEdge) {
gamelevel.x -= (stagePosition-rightEdge);
if (gamelevel.x < -(gamelevel.width-stage.stageWidth)) gamelevel.x = -(gamelevel.width-stage.stageWidth);
}
if (stagePosition < leftEdge) {
gamelevel.x += (leftEdge-stagePosition);
if (gamelevel.x > 0) gamelevel.x = 0;
}


So for a vertical position I would just need to replace the x's with y's and make a static const for roof distance?


var stagePosition:Number = gamelevel.y+hero.mc.y;
var rightUEdge:Number = stage.stageHeight+roofDistance;
var leftUEdge:Number = roofDistance;
if (stagePosition > rightUEdge) {
gamelevel.y = (stagePosition+rightUEdge);
if (gamelevel.y < +(gamelevel.height+stage.stageHeight)) gamelevel.y = +(gamelevel.height+stage.stageHeight);


}

if (stagePosition < leftUEdge) {
gamelevel.y += (leftUEdge+stagePosition);
if (gamelevel.y > 0) gamelevel.y = 0;
}
}

The screen does scroll up in this instance but only if I go downwards. Your thoughts?

Platform Game
Hi, I have a problem im making an rpg (role playing gAME)
so far all I have made is a chracter who is movable. I would like this character to be able to jump, when i Tried it I couldnt Get HiM baCk DoWn again. any HeLp iS aPpreciated. thanks alot.

Platform Game
hi i m making a platform game, could ya help me out i want a guy to be able to jump when you press up and come back down to the floor or a platform. thnx.

My Platform Game:(
ok in my game i want a code so that when the default enemy (the square)
comes in collision with spiderman, the health bar up at the top width goes down 10.
Someone Please help!!!!!!!!!!!!!!

http://media.putfile.com/spideygame44

Copyright © 2005-08 www.BigResource.com, All rights reserved