Actionscript 3.0 :: Hit A Brick More Than Once With Ball Created?
Aug 3, 2009
how to hit a brick more than once with my ball created, i just want it to happen to random bricks only.
here is the coding;
Code: Select allpackage {
import flash.display.*;
import flash.events.*;
[code]....
View 1 Replies
Similar Posts:
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
May 15, 2009
I am currently making a brick breaker game, so I want to make the ball bounce from the paddle. My paddle's name is pwn and the ball's name is ball.
My code for ball is currently:
onClipEvent (enterFrame) {
this._y += 5;
this._x += 4;
}
[Code]....
I just want the ball to bounce somewhere else other than stopping the ball at the place. I already made sure the paddle can move and the boundaries block the paddle from leaving the stage. So can someone give me the codes (please simple for me to copy-paste) for having me to bounce the ball some opposite direction or whatsoever. Like once the ball touches the paddle, it reflects somewhere else at the same speed and a different direction without any errors.
View 1 Replies
Mar 19, 2007
I am dynamically creating a movieclip, say, a ball. I want to apply a movement to each new ball created. I have created a movement function and now I need to know how to use this function as a method on each newly created ball. Would I do something like this:
[Code]...
View 2 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 11, 2009
i have a pb, i want to create 2 types of brick ,i haven't understood where he defines that 1 apply to a certain brick.or is it even that...so really, do anybody knows how to make a array with 2types of brick? from that tutorial?
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
Apr 14, 2010
im trying to figure out how to hit a brick more than once with my ball created, i just want it to happen to random bricks only.here is the coding;
Code: Select allpackage {
import flash.display.*;
import flash.events.*;
[code].....
View 1 Replies
Mar 14, 2009
I have only one question but phrased it 3 ways:
1) Is it better to pre=render things say in photoshop or have flash render them?
2) if I have a field of stars that drift along; is it better to create that Star Field in photoshop as a single picture (say a .png) or to create a star in my library and add it to a movie clip and then have that drift along?
Lets say I have a blur effect on my stars and have an equivalent on the photoshop.
3) I have heard (and experienced) adding effects like blur takes a fair amount of CPU and memory so was wondering if I created the effect in photoshop and then imported the 'blurred' object into my flash if I could cut down on system resources?
View 2 Replies
Dec 11, 2009
When an instance variable is constructed by a constructor method, why do you need to refer to the current instance variable being created when its the only one being created? I understand assigning an expression to it but why name it "this." when it is the only object that the constructor is building? Does it have some hing to do with being able to naming that object in the Local Variable? In other words am I creating a generic object that will be named in another class?
View 7 Replies
Jun 12, 2009
I am trying to get a ball from left to right I click in 28 and insert keyframe then I right click and click on create motion tween nothing happens. When I do this same thing on the sample one with the car this is what I get. and when I do the ball one sample2 it don't have the blue bar.
View 9 Replies
Oct 1, 2009
I'm a AS3 noobie and have a simple question:Quote:var ball:MovieClip = new Ball();var inc:int = 0;stage.addEventListener(KeyboardEvent.KEY_DOWN, onKey, false, 0, false);
View 2 Replies
May 27, 2011
I am trying to throw a ball in an arc, either an arc going left or right.
Here is my code:
var gravity = 2;
this.velocity.y += gravity;
_angle = 5;
[Code].....
It doesn't really look like the ball is "arcing" at all, it seems to be more of a diagonal line?
View 3 Replies
Dec 6, 2010
I need to get my movie clip to move across the screen from (30,100) to (600,100). I have a ball moveclip which loops and looks like it is rotating, therefore I need to create the actionscript code to just move the ball from the points listed above and then it will look like its rolling.[code]But I am getting this error; Access of possibly undefined property x through a reference with static type Class.I have the movie clip named ball with a class of ball_mc and it is exported for actionscript, I dont understand what the error is trying to say?
View 3 Replies
May 15, 2009
I'm working on integrating Omniture into an Actionscript 2 custom written video player.Omniture is not playing ball at all and their documentation for their Actionscript component is very poor, and they don't provide tech support for it.
View 1 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
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
Feb 7, 2012
I am trying to follow and create a tutorial which explains how to make a bouncing ball.I am really struggling with the Action Script 3.0 even though the teacher types it in.I am inserting the code so that you can view it.[code]
View 3 Replies
Aug 20, 2009
The ball created below is drawn as a red ball I want also to write its name "red" and place it on the ball whatever the ball position on the stage is
[Code]...
View 3 Replies
Jul 27, 2009
I'm running a hitTestObject for when ball hits target1 - The working code works great below.
Is there a way to have the ball hit multiple targets? Instead of hitting just target1 can it return when it hits target1, target2, target3..etc.
[Code]...
View 2 Replies
Mar 13, 2011
Maths was never my strong point and I have been attempting to speed the ball up that I have in flash. The ball is dispatched like this;
[Code]...
It almost works, however the results are not consistent. Sometimes the ball gets faster, and sometimes it becomes extremely slow.
View 9 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
May 13, 2011
So I am trying to create a document class for my program, and I know all the code is correct because I already have the program working.I am currently trying to rebuild the program, and I simply copy and pasted all the working code into my new program.I have 2 document classes, and when I run the program i get an error, and I don't know how to fix it. It says "The class 'ball' must subclass 'flash.display.MovieClip' since it is linked to a library symbol of that type."I don't understand why it isn't working now, is there some setting that I need to turn on to get it to work? I do have the line of code: import flash.display.MovieClip;
View 3 Replies
Oct 5, 2009
I made this ball that spawns particles out of it. The particles are the same size as the ball, so they end up above the ball, therefore, I cannot pick it up! I heard something about getChildIndex(), but I wasn't able to solve the depth. How do I get the ball to be on top all the time?
View 1 Replies
Jan 15, 2003
i have just came across the tutorial with physics/bouncing ball - so far i have encountered no problems in understanding it, but just a question:how do i stop the ball bouncing? do i have to equal it to a certain value or just drop in another if/else statement, because now the ball seems to bounce forever, since it gets every time multpilicated by a negative number.
View 2 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
Jan 19, 2006
I want to do gravity effect on a ball . I found some thing do this but I need to make the ball goes to the floor direction actually I want it to follow the sloping of the floor with the gravity effect .
View 14 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
Jul 17, 2003
There are two stationary balls-ball A and ball B. There is another ball- ball C, which has to move from ballA to ballB.The problem is that when the I "run" the movie, ball C is automatically placed at the position of ballB. That is, I do not see ball C moving from the position of ball A to the position of ball B.I have used a line-drawing algorithm to move ball C. Also, the entire stuff is written in Actionscript. PS:this._x++ and this._y++ will not work because ballC has to travel the exact path between the two balls
View 4 Replies