ActionScript 2.0 :: Cant Get Ball To Bounce Off Of Paddle At Correct Angle
Apr 28, 2004
The game is like any other pong game with one differance. Rather then the paddle only moving left and right, it would move in a circle around the play field and you would not be able to rely on the walls to keep your ball in play. My problem is that I cant get the ball to bounce off of the paddle at the correct angle. Below is a link of the swf and fla that I have now.[code]
View 7 Replies
Similar Posts:
Oct 29, 2003
how to make the ball move and bounce around the stage. and i also need help on the paddle that the ball bounces off of.
View 11 Replies
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
Nov 3, 2006
im was wondering if anyone knows the script for a ball bouncing off a paddle. I want the ball to bounce off the paddle in different directions depending on:
1) which side of the paddle it hits
2) which direction it came from
Ive only got this so far : script for the paddle
onClipEvent(enterFrame)
{
if (this.hitTest(_parent.ball)) //if this movieclip hits the movieclip 'ball'
tellTarget(_root.ball) //tell the ball to:[code]....
View 1 Replies
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
Nov 3, 2010
I have this code to make a ball bounce. it works fine, however, everything on the stage bounces. I only want the ball to bounce.
Here is my code
/* Actionscript 3.0 Bounce Effect. ball = movieclip instance name*/
var velocity = 0;
var gravity = 2;
var speed = 0.03;
var ground = 300;
Object(this).ball.addEventListener(Event.ENTER_FRAME, fl_bounce);
function fl_bounce(event:Event) {
[Code] .....
View 5 Replies
Apr 27, 2011
I'm pretty new to Flash and I've ran into a bit of an issue. I'm trying to convert a AS2.0 code into a AS3.0 code, more specifically I'm following this guide:
[Code]...
View 8 Replies
Jul 27, 2005
I'm making a ball that are going to bounce realistic..But it doesn't!
View 4 Replies
Oct 4, 2005
I'm trying to make a ball to bounce on something realistic.How can I make it work? It's impossible.
View 3 Replies
Aug 16, 2003
I have used this code for getting a circle going from the top and down...
Now i want it to bounce back to the top but i don�t know how to integrate it to the code.
onClipEvent(load){
myscale=290;
}
onClipEvent(enterFrame)
[Code]....
If anyone will explain how the code works(cause i�m no good at this Action Script),- i will be glad.
View 3 Replies
Feb 13, 2011
So I am trying to get a ball to move around the screen, and when it gets to the walls of the stage I want it to change directions. So far, I have this code:
Code:
import flash.events.Event;
var ballVelx:Number = Math.random() * 15;
var ballVely:Number = Math.random() * 15;
var ballDirx:Number = 1;
[Code].....
This is not in the main timeline, it is in the symbol timeline for Ball. With this, I have the ball moving around and when it reaches the end of the stage it resets with a random velocity/angle. When I uncomment the ballDirx and ballDiry lines and comment out the this.x = 0 line, the ball doesn't change directions, it just stops moving when it reaches the end of the stage.
View 6 Replies
May 1, 2005
I haven't done much actionscript stuff ...and at the moment im trying to make a ball bounce across the stage, but im unsure how to go about doing that.
View 3 Replies
Jul 27, 2009
Just getting it to spin off and react realisticly with the wall would add a whole new dimention, but its a bit beyond me (*noob!*). It calls for some collision recognition I think, but the forums I've read so far on the topic are just too complex. My aim is also to also bounce the ball off the cursor.
View 3 Replies
May 5, 2010
I'm having problems with my flash game, i am making slimeball and im using the hitTest to make my ball bounce off of the players, but because my players are semi circular when it hits off the back of my player the ball still goes forward when it should bounce off the player in the direction that it came from, if that makes sense
[Code]....
View 1 Replies
May 1, 2005
I haven't done much actionscript stuff ...and at the moment im trying to make a ball bounce across the stage, but im unsure how to go about doing that.
View 3 Replies
Oct 29, 2003
I cant figure out how to make the ball move and bounce around the stage. and i also need help on the paddle that the ball bounces off of. if u could help me out that would be awesome.
View 11 Replies
Feb 10, 2006
In the process of making a pinball game, i wanted to set up a system where a ball would bounce on an object, and eventually come to rest on it. Everything works fine, but eventually the ball just goes through it instead of coming to rest on top of it. I do not understand why this happens, and would like to know if there is anything i can do to fix this. The .fla is attatched.
View 4 Replies
Oct 12, 2004
I make this simple system to simulate a collision of a block in "walls" and bounce like a pong ball. To use drag the orange square and release to start the movement. But I have a problem, sometimes the collision not happen and the block go through the walls, I try less the time of setInterval that verify the collisions but not solve my problem.
collision system -> [URL]
View 3 Replies
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
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
Jul 5, 2009
I followed this tutorial to make a bouncing ball in flash. Its AS2 so it took me some time to make it work in AS3 Now I want to make the ball roll down a slope, fall and bounce when it hits the ground. I have attached my .fla.
View 1 Replies
Jun 28, 2010
Say for example I have a ball and I would like to move it towards a specific angle and a specific magnitude I would use something like:
[Code]...
Now if I wanted to change this force, for example, add a force to it, say, with magnitude 0.5 and angle 20, how would I do that?
View 2 Replies
Apr 13, 2003
I followed the bit101 tutorial on gravity and now have a movie clip called "ball" (instance name) with an embedded invisible button (so you can throw it all over the place).I also have a movie clip called "block1" (instance name too! what a coincidence, isn't life lovely). I want to make them collide, and make the ball bounce away.
View 1 Replies
Feb 9, 2005
Ive made this rotation with AS. But Id like to make the bar to move from angle A to angle B smoothly.
How can I do this?
View 2 Replies
Jan 3, 2011
I'm making a game like Arkanoid and to move the ship with mouse, I'm using the following code :
var mousex:int = costume.stage.mouseX;
if (mousex < paddleWidth/2)
mousex = paddleWidth/2;
else if (mousex > PhysiVals.STAGE_WIDTH - paddleWidth/2)
[code]....
Everything's going fine there! The paddle is moving the way it should! The problem is I want a little inclination towards the direction its moving and when it stops moving the angle of inclination should become zero.
View 1 Replies
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
May 3, 2005
I have attached my FLA & I was just wondering if anyone out there could tell me how to make it so that my paddle will move so that the pong game is playable.
View 4 Replies
Dec 30, 2009
I'm trying to get the depths of all the blocks to be at the correct levels at the correct times so that the 3d effect is maintained. I've tried many things, but have had little success. All the instances of the blocks are stored in an array, but since it's adding them in accordance with when they're added to the stage, it doesn't help me locate them to swap depths. Is there a way to arrange them by location on the board?
View 4 Replies
Dec 18, 2006
I have a simple ball class where it bounces and such and stays on the stage based on boundaries. right now im using a for loop to attachMovie("ball",...) in my main fla file
which is basiclaly my movieclip that has the AS 2.0 class pointed to it. It bounces fine using the tutorial on Kirupa(by senocular?) i want these balls to bounce off each other too?
View 1 Replies
Jul 5, 2003
I would like to know how to "bounce" a movieclip. Not sure if that is the right term for what I'd like to do.URL...When you click a button the background images kind of bounce into place.I know how to control a MC but how would you make that bouncing effect?
View 3 Replies