Boundaries - Ball Will Get Stuck In The Wall And Slowly Travel Upwards

Feb 8, 2009

I am making a pong game and am having some problems with the boundaries. The ball bounces off just fine but if i hit it to close to the boundary, the ball will get stuck in the wall and slowly travel upwards. Bouncing back and forth. It happens on both sides. Also How do you set a key press movement to stop. I want to be able to stop at the boundary if i hold the left key down but it would stop the game entirely. I have it set now so that the controls reverse every time a boundary is hit. My big problem is the boundary though. I will eventually figure out the paddle movement on my own. Another problem I am having is getting my score value to increment correctly. It always reads as a NaN until I score. When I do it goes 1, 11, 111, and so forth. I have the variable set as number values but the dynamic box, I think, is still reading them as strings

View 1 Replies


Similar Posts:


ActionScript 2.0 :: Jump And Boundaries (character Can Go No Further Than A Wall Or Something)

Dec 12, 2003

make a character jump by using spacebar make a boundry (character can go no further than a wall or something)

View 1 Replies

ActionScript 2.0 :: CS3 To Redirect A Ball Off A Wall?

Nov 20, 2011

I'm trying to make it so that when the ball hits the wall, it bounces off of it.. this is my code

Actionscript Code:
var elastic:MovieClip = _root.createEmptyMovieClip("elastic", 1);var point1:MovieClip = _root.attachMovie("sling", "point1", 3, {_x:50, _y:200});var point2:MovieClip =

[code].....

View 3 Replies

IDE :: Bouncing A Ball Off A Wall Object

Apr 26, 2010

I have created a flash AS3 file with two movieclips. One is a ball (ball_mc) and a wall (wall_mc). The ball bounces around off the outer walls of the stage, in horizontal lines.

The ball also changes direction if it bounces off the wall. However its not bouncing off the wall in the right direction?

Code:

var dx:Number=3; //the amount the ball will move horizontally each frame
var dy:Number=5; //the amount the ball will move vertically each frame
this.addEventListener(Event.ENTER_FRAME,moveBall); // call the function moveBall every frame

[Code].....

View 6 Replies

ActionScript 2.0 :: Ball Is Not Bouncing Off The Wall?

Apr 12, 2005

below is the code I am useing I have created a simple frame with 2 layers one named body and one named Code in the code frame I have

[Code]...

In the body I have 4 walls all named top bottom right and left they are movies and they are named in there instance the same I have a circle I named ball and made it into a movie and named it ball yet when I run the flash file the ball flys off the page and doesnt bounce inside the boxes?

View 7 Replies

ActionScript 2.0 :: HitTest Glitch With Ball And Wall

Feb 8, 2009

I'm making a game where the ball bounces off several walls to get to its destination: the portal. When the ball reaches a high speed it glitches through most of the walls.Here is my scene for the 3rd level of my game where the most glitches occur (attached file)In the picture there lists all the variables i put in the objects. You will also notice that I put a "Stuck" button since there were many glitches.[code]

View 2 Replies

ActionScript 2.0 :: Make A Ball Bounce Off A Wall With The Same Angle?

Mar 17, 2002

I am familiar with hit test, but how do you make a ball bounce off a wall with the same angle that it bounced on it with?ex. it hits the wall at 45 degrees, and it bounces off the wall at 45 degrees

View 6 Replies

Full Screen Bouncing Ball Will Not Reflect Off Stage Wall?

Nov 5, 2009

I have added full screen code on my movie so that the user can extend the size of the movie. eg If the user expands the browser window to 1200 X 900, then my movie will become 1200 X 900 without the movie deforming.

Code:
Stage.scaleMode = "noScale";
Stage.align = "TL";

[code]....

View 3 Replies

ActionScript 2.0 :: Make A Ball Bounce Of A Wall And Stll Carry On?

Apr 26, 2011

i want to make a ball move at a constant speed into a wall and bounce of, initially it should move back but then It should carry on moving towards the wall.

I managed to make it bounce but once it hits the wall it carries on in the opposite direction!

View 4 Replies

IDE :: Design Banner - Get Stuck When The Ball Move In The Fla-file?

Apr 8, 2009

I have tried for a while to do a flash banner but i am stuck.I have cs4 flash installed.I want to have a banner like this one on top:http:[url]....My question is how to design this banner?I have tried to do a big banner in startup panel, i have read cs4 flash for dummies but i get stuck when the ball shall move in the fla-file.

View 4 Replies

ActionScript 2.0 :: Ball Hits The Brick In A Angel It Gets Stuck On The Insid Of The The Brick

Mar 5, 2004

i made a bouncing ball game. but i put a hitTest on it so that it would bounce off a brick. but what happends is that when the ball hits the brick in a angel it gets stuck on the insid of the the brick.

View 1 Replies

ActionScript 2.0 :: Make A Ball Bounce Off Something Like A Ball Bouncing Off A Bumper In A Pinball Game?

Jun 20, 2006

i wanna ask how do i make a ball bounce off something like a ball bouncing off a bumper in a pinball game? i've tried a lot of times but everytime the ball get stucked to the box and it doesn't move anymore...will be grateful if anyone noes the actionscript of it..

View 3 Replies

Professional :: Stuck On OnRollOver / OnRollOut Stuck?

Jul 5, 2010

I have a movie which is serving as a button.When you rollover the image, it grows, and stops.When you rollOut, it shrinks, and stops.This code works fine. The Problem:When you scroll the mouse over quickly, the animation get stuck and doesn't execute the rollOut code.This is most likely because the first rollOver action hasn't yet completed.Here's my code:

thumb_test_4.onRollOver=function  () {
this.gotoAndPlay(2);
}[code]....

View 9 Replies

ActionScript 3.0 :: Ball Collision Inside Another Ball Using Gravity?

Jun 5, 2009

ball collision inside another ball using gravity.I have one large circle in the middle of the stage (its radius is 150 pixels). I have another circle inside of that one (20 pixels radius), this is the smaller ball that I would like to have bounce around inside of the larger one with gravity. When the small ball hits the edge of the larger circle, I would like it bounce inwards to the center of the larger circle. It keeps doing this until it eventually stops in the center of the larger circle at the bottom.

View 1 Replies

ActionScript 3.0 :: Travel Along 3d Plane

Nov 10, 2010

Im trying to figure out how to travel along a plane to a point in 3d space. It needs to feel as though travelling down a road. I have attached a swf with the desired effect. Im using the formula scale = fl/(fl + z);the problem im having is it looks fine until scale is > 1. I need the plane to stay central to the screen.

View 0 Replies

ActionScript 2.0 :: Move Upwards 10 Pixels When Hit?

Dec 20, 2003

Ive got an object called "heart" and I have another object called "k". The heart follows the mouse and when the heart hits the k I want the k to move upwards by 10 pixels. Can anyone give me the AS on how to do this?

View 1 Replies

ActionScript 2.0 :: Snow Falling Upwards?

May 26, 2005

I've done the tutorial on falling snow but what I really want it to do is fall upwards... like bubbles on water.what part of the code I need to change...

View 6 Replies

ActionScript 2.0 :: [fmx] Travel In Direction Of Rotation?

May 14, 2003

I have a MC(a small army tank) that I can rotate using the right and left buttons. I want to make it move forward when I push the up arrow - The Catch . . . I want it to move in the same direction it is currently rotated. Example: I rotate the tank 10 degrees and then I push the up arrow off it goes in that direction.

View 2 Replies

Move A Distance Of 2178px Upwards On Stage?

Jun 8, 2009

I have a large image (w: 1071px, h: 2222px) which I need to move a distance of 2178px upwards on my stage and the quality of the tween is terrible.
 
I've ticked the box in the image properties to allow smoothing and I've also reduced the image quality to 50% but it still lags. I've tried chopping the image up into seperate pieces so that when some of the image has gone beyond the stage area and is no longer visible that part of the image is removed and flash no longer has to move it. I've used timeline and actionscript tweens. I've tried exporting a quicktime movie to see if the results would be any better but they were pretty much the same. I am pulling my hair out here!!

View 2 Replies

Actionscript 2 :: Have Flash Textfields Expand Upwards?

Feb 2, 2012

With actionscript2, is there anyway to expand make a text field expand upwards if more text was added then the current size could hold, rather than downwards? Data is loaded from XML.

View 2 Replies

ActionScript 2.0 :: Detect When The Mouse Has Moved Upwards Or Downwards?

Feb 18, 2009

Is there any way to detect when the mouse has moved upwards or downwards?

I currently have a mouse listener with an onMouseMove function that uses the _ymouse to detect any movement within a restricted distance.

But I want the mouse to detect up and down movements in any distance.

View 2 Replies

ActionScript 2.0 :: Force V2 ComboBox To Open Upwards?

Oct 15, 2005

Is there any code to force a V2 combobox to open updwards, rather than the default downwards?

View 1 Replies

ActionScript 2.0 :: Limit The Travel Of The Scroll Thumb?

Mar 26, 2007

I am currently working on a curved scrollbar. I want to limit the travel of the scroll thumb using two clip instances that mark the top and bottom of the scroller. To do this, I believe that I'll need to use localToGlobal on my top (topMark) and bottom (botMark) markers. Unfortunatly, my attempts to get the global coordinates has failed. In the attached file, the code can be found in the actions layer of the curvedScrollbar clip.

View 1 Replies

IDE :: Using MC Tween 2, Updating Travel X, Y Coordinates On Runtime?

Aug 11, 2009

what I am trying to achieve using MC Tween 2. I need to be able to update X, Y coordinates while the tweening is running. I don't want to restart it but update X, Y values. For example, I want to modify the distance to travel on an object in given time. It means that if tweening started with distance to travel 100px on Y coordinate and time to ravel is set to 10 seconds and if I change Y coordinate within 1 second of 10 to 200 px the the rest 9 seconds will tween the object to the 200 px point. I hope I described clear.

View 4 Replies

ActionScript 3.0 :: Flash Travel Distance Calculator

Jan 18, 2011

I am given a task by my client to develop a calculator which will calculate the Cab fair from one location to another. There is a list of Cab fairs as well as their corresponding Location Name. It would be displaying the results on the screen.

[Code]...

View 1 Replies

ActionScript 2.0 :: Make A Mc Bounce Then Travel Forward Again?

Apr 24, 2011

I managed to get the bounce working how do I make it continue to move forward after the collision?

View 5 Replies

ActionScript 2.0 :: MX04 Making Object Get Propelled Upwards

Nov 30, 2009

Im trying to make a character get propelled upwards when he steps inside a bubblejet, but as i am very new to actionscript i have no idea where to start. heres what im trying to do:I hope that makes sense! im sure it will be a simple thing to do just i really am clueless!

View 2 Replies

ActionScript 2.0 :: MX04 : Making Object Get Propelled Upwards?

Sep 21, 2011

Im trying to make a character get propelled upwards when he steps inside a bubblejet.

View 7 Replies

ActionScript 2.0 :: Make A Spring To Launch The Character Upwards?

May 23, 2011

I'm making a platformer, and I'm trying to make a spring to launch the character upwards, and im using this script:

Code:
_root.player._y -=300

The code works, but it just teleports the character 300 pixels upwards, but I need a fluid motion.

View 2 Replies

ActionScript 2.0 :: Using MC Tween 2, Updating Travel X, Y Coordinates On Runtime?

Aug 11, 2009

what I am trying to achieve using MC Tween 2. I need to be able to update X, Y coordinates while the tweening is running. I don't want to restart it but update X, Y values. For example, I want to modify the distance to travel on an object in given time. It means that if tweening started with distance to travel 100px on Y coordinate and time to ravel is set to 10 seconds and if I change Y coordinate within 1 second of 10 to 200 px the the rest 9 seconds will tween the object to the 200 px point.

View 1 Replies







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