ActionScript 2.0 :: Making A Ground?

Oct 14, 2008

im making a 2d game with platforms and walls and floors and such, i've got most of the physics i need. gravity, speed, ect. But when he is supposed to stop after "hitting the ground he just goes straight thru. The ground he should stop at is a mc called bg and inside is a mc called platform. what am i doing wrong?

Code:
onClipEvent(enterFrame){
//Keeps Character from going thru the floor, roof & walls
if(this.hitTest(_root.bg.platform)==true
gravity = 0;
}

View 4 Replies


Similar Posts:


ActionScript 3.0 :: Keep The Player On The Ground?

Sep 14, 2011

I have made racing games in the past, but never a side scrolling type.Im trying to make one similar to this: http:[url]...But how would you keep the player on the ground? well not stuck to the ground because we would want the player to be able to use things like ramps.

View 5 Replies

Actionscript 2.0 :: Platformer With Ground And Water?

Aug 21, 2010

i'm currently making a flash game which has ground and water.And its going to be big.For someone whos 13 like me i have problems.The script was edited recently so sorry to anyone who was working on it.the issues are underlined.here the script.

onClipEvent (load) {
grav = 2;
speed = 15;

[code].....

View 2 Replies

ActionScript 3.0 :: Reference Ground MovieClip Through Out Game?

Nov 2, 2011

I have three movieclips in my library (Ground1, Ground2, Ground3). Depending on the game level I want to use a different one but I reference the ground movieclip through out the game. How can I declare the variable (i.e.
var ground:Ground1

So I can set ground to a different library clip like this:
if(level == 1){
ground = new Ground1();
} if(level == 2){
ground = new Ground2();
} if(level == 3){
ground = new Ground1();
} ground.scaleX = 10;
ground.scaleY = 10;
worldSprite.addChild(ground);

View 1 Replies

ActionScript 3.0 :: Platform Game Fall To Ground Function?

Feb 16, 2010

I have gotten to a point with my platform game where I am completely stuck. I have the player movement working fine but the only thing is, it doesn't fall off the blocks.

I have a Floor class which references the Character class and tells it to stop jumping when it is on a block through a hitTestObject. I have tried to research how other games have added functions but can't seem to find one which will work in mine.

View 1 Replies

ActionScript 3.0 :: Flash Multiple Ground Instances Using Arrays

Feb 26, 2011

I'm working on a game engine with a friend of mine, we plan to make it open source so other people can use it too for their own games. We basically have everything done, but I really want to add multiple ground instance support. I would like to use an Array, to call upon all ground layers on the stage, and put it into one call name for my gravity function. So I wouldn't have to have various strings for each ground instance.

Code:
var groundArray:Array = [ground, ground2, ground3];
var groundtile:MovieClip = groundArray[1];
addChild(groundtile);
This is my gravity..
[Code] .....

What I have so far works perfect without arrays.. When I add my above array, I don't get any errors.. but I fall through the ground.

View 2 Replies

ActionScript 3.0 :: Static Objects In 3D Space Move On Ground?

May 3, 2011

I am using away3D and I have come across a stumbling block I cant get anyone to answer. I have tried EVERYTHING and I am not getting an answer on away3D forums.I place objects in 3D space. where the houses start at different y -value and z -value for reasons I dont know so they can look level.IT takes about 30 sec to load but here is my example of the problem . The objects move on the ground when they should not. I am just moving the camera. I dont underatnd how you place objects in 3D space in away3D.Here is the issue with my program after MANY hours of endless fiddling. The y value of the plane. It looks the same with value at -100 or -140 but it works at -140 where it is under all ojects. AT -100 it looks under all objects but doesnt move properly. Objects and the plane (ground) dont seem fixed.

// plane = new Plane({material:mygrass, name:"plane", z: 200,y:-100,x:-100, width:1000, height:1000, pushback:true});
plane = new Plane({material:mygrass, name:"plane", z: 200,y:-140,x:-100, width:1000,

[code]......

View 5 Replies

ActionScript 3.0 :: Flying Object Leave Glitter Behind That Floats To Ground

Oct 21, 2010

I've got an object flying through the air, but I want it so that the object leaves a trail of glitter behind itself and that glitter floats to the ground. What would be the best way to do this?

View 2 Replies

ActionScript 3.0 :: Buttons To Fall And Bounce To The Ground Like A 'bouncing Ball'?

Feb 24, 2012

So in my level 1, here's what I wanted it to look like:on enter frame, a few of my "drag-gable" buttons are going to fall to the ground, bounce a little bit and stop when they ran out of speed.Attached the file that I've already scripted the drag n drop on each button, now how do i script the "fall to the ground part"?

View 0 Replies

ActionScript 3.0 :: Curved Surfaces - Find The Utmost Y Point Of The Ground At A Given X?

Oct 30, 2009

So I have a ground that's supposed to be, for the most part, curved. How can I find the utmost y point of the ground at a given x? The ground looks like so: The function I have right now sort-of works, but seems very inefficient. You input an x parameter, and the function loops using hitTestPoint with a constant x and a y that increases until it hits the ground. Then it returns that y value. Is there a better way to do this? This method seems like it would get slow.

View 4 Replies

ActionScript 2.0 :: Make A Game - Mc Doesnt Fall Through The Ground When He Jumps Or Walks?

Jun 25, 2005

Well, basically i need to make my game so my mc doesnt fall through the ground when he jumps or walks, coz so far all he does is jump, then fall through the floor.

View 3 Replies

Flex :: Set The Back Ground Color Of A Data Grid Cell To Yellow When Value Of A Cell Is Greater Than 6

Dec 6, 2010

Iam using flex 3.5 . I want to set the back ground color of cell in a datagrid to yellow when the data in it is more than 6 .

View 2 Replies

ActionScript 3.0 :: Getting 1120 Error "ground Class Saying That Access Of Undefined Property Char"?

Mar 29, 2012

Alright so I was creating a game in AS3 and then I was told that I should have put them in classes so I moved all the code to classes and I get an error from the ground class saying that Access of undefined property char. Here is the code to see what I need to add to it so char isn't undefined anymore.

Code:
var gravity:Number=1;
var yVelocity:Number=0;
var canJump:Boolean=false;[code]..........

View 2 Replies

ActionScript 3.0 :: WTF - CS5.5 HitTestObject - Drag Player And If The Play Htis "ground" Nextframe Should Be Played?

May 21, 2011

It was long time sense i play with Flash so i decided to start agian. I wrote this really easy code in AS3, in FLASH cs5.5: PHP Code:

[Code]...

That means that i can drag my player and if the play htis "ground" nextframe should be played. BUT it doesnt work for some wierd reason? Why?

View 1 Replies

ActionScript 2.0 :: Make Drag And Drop "ground"?

Nov 5, 2010

Hw is it possible to make an drag&drop object and make it "physical", so main game character can walk on it, jump on it ect. as on a ground?

View 9 Replies

ActionScript 3.0 :: Making Spacebar Act As Mouse For Making A Sidescroller?

Feb 8, 2011

For a project, I'm making an interactive side scroller.You move the character with the arrow keys and press the space bar to interact with things.So far, I followed DexNote's tutorial on YouTube.I thought that I would make the interactable objects as buttons, while the mouse focus would be on the character and when you press the space bar it make a mouse click in that area.The trouble I'm having now is that I don't know how to make the space bar trigger the "interactions."

View 1 Replies

ActionScript 2.0 :: Making A List And Making It Fast

Jul 12, 2003

I want to generate large text files, basically 4 columns, several thousand rows, of numbers. Making an array with all this info in it occurs farily quickly, it's getting it to a displayable format that takes a really long time. Right now I use something like this:

[Code]...

View 10 Replies

Making A HUD For A Game ?

Jul 8, 2010

I am working on a Heads up display and I am having some problems. The Problems are i cant seem to get Flash to do what I want...I am relatively new to flash but I know that I need to use action script 2.0 and Kismet to make what I want happen. (I am using the UDK and Scaleform for the development of the game I am helping with)Here is what I am doing.

I am making a cross hair. When I highlight an enemy it should turn red. When it Highlights an ally it should turn blue.I have made a heart beat Monitor that needs a animation for a heartbeat and Flat lining. The Background of the Heart beat monitor Changes color according what has happened to the player, If the player Gets hit the background of the heartbeat monitor changes color. If the Player gets hit too much the Heart Beat Monitor will flat line.Then I am making a radar for the hud.

View 1 Replies

Making The MC Point Towards The Cursor?

Mar 14, 2009

Making the MC point towards the cursor?

View 3 Replies

ActionScript 3.0 :: Making Two MCs Work At Once

May 4, 2009

In Actionscript 3.0 I want to make two timeline animation happen at the same time. I can't seem to get it to work.

Do I need another eventlisetner and function to perform this extra animation or can i nest it in the function that is already there?

Here is my code:

Quote:

stop();
close_btn.addEventListener(MouseEvent.MOUSE_DOWN, closehandler);
function closehandler(evt:MouseEvent):void {
gotoAndPlay("closeHere");

[Code]....

View 15 Replies

Making Random Not Repeat?

Aug 25, 2009

Im wanting to change the variable numSound. At the moment it is a random number 1-5 which works well but I dont want repetition. Tried all sorts of things but no luck.

Code:
private function randRange(min:Number, max:Number):Number
{

[code].....

View 6 Replies

Making Edits More Efficient?

Aug 28, 2009

what are some tricks and tips for making editing across frames quicker and more consistent? For example, if I have an animation with many frames and/or multiple scenes is there a way to add or move an element so that it appears the same way across all of the frames?

View 1 Replies

Making A Game In Flash?

Sep 25, 2009

Im planning on making a game in flash thats going to be kind of like a breeding game for birds.

View 2 Replies

Making A Button On An Imported PSD?

Aug 12, 2010

it seemed like a simple process but I cant seem to get this right... I got a button there, but the URL wont go, ie, the click does nothing.I imported a PSD layered image to Flash CS3, into a new blank layer. I need basically an area of this PSD to be "image mapped" so what I did was create a rectangle with the rect tool, over the area I needed the hot spot.Here I tried to do a transparent box and border (alpha 0) but the outline is still there even though the box is "empty." I did select the transparent box, no color, and tried alpha, both same result)I made that into a symbol, then I double clicked into there to fill in the key pts for the over, hit, etc., states.... I dont have any effects here btw, as simple as we can get.After that I right clicked on the buttonand entered the action script ("reserve" is the name of my button symbol)

reserve.onRelease=function(){
getURL("http://www.redeggnyc.com/menu2.htm");
}

[code].....

View 2 Replies

ActionScript 2.0 :: CS3 Making Mc Loader URL?

Oct 12, 2010

I have 4 small invisible buttons on one timeline. Each of these small buttons loads an external jpg into a movie clip container.I want each one of these external jpgs that load into the same mc container to go to a new web page. I am trying to do this with a invisible button that goes over where the external jpgs show up. What is the best way of doing this?

View 3 Replies

(cs5) Making A Rollover Animation?

Oct 19, 2010

im making a button and on the rollover animation I want to have it splatter paint, only thing is I dont know how to get an image into flash that doesnt look crappy. I know that I need a vector image, but im not familiar with vectors as I usually use photoshop. I tried using a photoshop brush image, a simple paint splatter in which I was just going to tween to a larger splatter but like I said the image looks blurred because itsa bitmap.

another newbie question, but when you make an animated button, is the background included in the animation? Like lets say I import a button, give it an animation to glow on rollover or something, if i went to use that .swf would the background that it was placed on show? or would it just be the animation that shows on the default web browser background.

View 3 Replies

Flash5 Making Stickman?

Oct 22, 2010

I am awful at Flash, but have the new ver. Flash CS5. I use to be able to make a stickman.

Turn Onion Skin on
Draw stickman
F7
Draw his next movement
F7
I turned on onions

View 3 Replies

ActionScript 3.0 :: Making Sure A Mc Is Displaying

Dec 2, 2010

Have you ever had to make sure something is loaded on screen before another method occurs?? This is driving me round the bend!

So basically I have a method that makes the system freeze for half a second while it loads some data

on press of a btn to request that data, first thing I want to do is add a loading icon.

I then make the request for the data.

Problem is even though the load icon code is set before my data request method. Its doing the request before it adds the loadicon!

So I have tried to use listeners like ADDED which are trigged but still it seems the loadicon only appears after the the request method is made.

My code looks like this.

Code:

loadingicon = new loaderIcon();
loadingicon.addEventListener(Event.ADDED, doit);

[Code].....

View 2 Replies

Making Swf Instead Of An Animated Gif / Should Use Png's Or Jpeg's

Jan 25, 2011

I have an animation about 30 frames long, the dimensions are 500x700 pixels.I want to use swf instead of gif because of better quality. So should I use png's or jpeg's to animate the swf?Which format does flash like better?

View 7 Replies

Making Scrolling Text In CS5?

Feb 4, 2011

I have a simple text field that is read only and it's very long, so I just want to use a scrollbar on the right-hand side. I dragged a UIScrollbar component to this text area, I lined it up, same height, and even named the text area as the scrollbar's target, but when I compile the swf, I get a blank scrollbar next to the text and 2 other scrollbars off the the right of the text!!! I also tried adding the scrollbar via code with the same results.

View 2 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved