ActionScript 3.0 :: Collision And Reflection - Move X / Y Properties

Jan 22, 2011

I'm making a game with a moving avatar (it moves by itself ), his direction is given by a vector which only change when colliding with another object (which I called Mirrors ). So my avatar has a moveX and moveY properties ( sort of vector so ). And by clicking and holding the click to somewhere else, then releasing it, you can trace line (Mirrors) which have properties like start and end coordinates, a normalized vector for them, and a normalized normal vector. When the avatar is colliding with a mirror, its move vector change, to be redirected like with a mirror reflection.

Here are problems : The collision is only check before the avatar move, so if my avatar move 3 pixels by 3 pixels, and if my mirror is like x = 5-10, my avatar x = 1, it will move one time : avatar.x = 4, no collision. second time : avatar.x = 7 : collision, but my avatar is partially "in" the mirror, so weird... To solved it, my avatar only move 1 pixel by 1 pixel..

Second problem, when my avatar come in contact with the "bottom" or "top" of my line (imagine a vertical line), it does some strange things like go through the line and shaking.. I don't know how to manage that, it actually occurs sometimes even if it does hit at the line itself.

View 4 Replies


Similar Posts:


ActionScript 3.0 :: Added A Reflection Class But Can't See Any Reflection

Mar 6, 2009

i've added this reflection class [URL] to this simple .fla file, but i can't see any reflection [URL]

View 2 Replies

ActionScript 3.0 :: Game Collision Detection - Error #1010 : A Term Is Undefined And Has No Properties?

Sep 2, 2010

ok so I am making a game for a college course and I am having some difficulty getting the collision between my player and the walls to work. Here is my code

Code:
// Collision Wall Test
public function WallTest()
{[code]...........

I'm getting this error every time the function is called

"TypeError: Error #1010: A term is undefined and has no properties.at GamePlay_v01/WallTest()at GamePlay_v01/keyDownFunction()"

I've been at it for hours and cannot figure out for the life of my why its not working. I have set up sentry points around as a perimeter on my character.

View 6 Replies

ActionScript 3.0 :: Move On Timeline After Collision?

Mar 21, 2011

I would like for when my mc "touches" a door on my stage, for the animation to jump to another place in the timeline. I do not know how to do that though, but I assume it has something to do with collision detection?

View 2 Replies

ActionScript 3.0 :: Move 3d Clip Without Change 3d Properties?

Aug 7, 2011

I need to move a 3d transformed object (ex. image) from x=0 to x=500 (for example)
The problem is that the 3d transformation changes along the movement.I want to constrain the 3d transformation so the image distortion (perspective) doesn change.

View 10 Replies

ActionScript 3.0 :: Asset To Move X,y Position Or Alter It's Properties Depending On The User Environment?

Feb 22, 2012

If you don't add an asset (text field, mc, btn etc) to the stage / create the object dynamically, is it possible for the asset to move x,y position or alter it's properties depending on the user environment? If so, what environments can cause this? IE what browsers, op. systems, player versions etc?

View 4 Replies

Collision Detection Incorrectly Detecting Collision?

Oct 16, 2009

In my file (AS2), I have a small square at the middle of the page. Diagonally to the right, I have a vertical wall which is a rectangle. Pasted inside my small square, I have the code:

onClipEvent(enterFrame) {
if (Key.isDown(Key.RIGHT)) {
if (this.hitTest(Wall._x, Wall._y, false))  _x =

[code]......

View 1 Replies

ActionScript 3.0 :: Art Gallery With Reflection?

Nov 17, 2011

I am new to actionscript 3 and I wanted to know if anyone could direct me to some websites (Tutorials) which can help me create a gallery like the one in the link but using AS3. Any help would be really appricated, I am not asking for the code just tutorials I can use to create someting very similar to it. [URL]...

View 4 Replies

ActionScript 2.0 :: Make A MovieClip Reflection Using It?

Jul 15, 2007

Is there a way to make a MovieClip reflection using fully actionscript 2?

View 5 Replies

ActionScript 3.0 :: How To Make A Water Reflection

Dec 4, 2010

I have a picture that I want it to look like its sitting in the water how can I do this I have no clue is there water reflection effects in AS3 Flash?If there is can I have an example?

View 1 Replies

Flash :: Reflection Of A Point Over A Line?

Aug 4, 2011

I have been looking at how to reflect a point in a line, and found this question which seems to do the trick, giving this formula to calculate the reflected point:

Given (x,y) and a line y = ax + c we want the point (x', y') reflected on the line.

Set d:= (x + (y - c)*a)/(1 + a^2)
Then x' = 2*d - x
and y' = 2*d*a - y + 2c

However there are two problems with this implementation for my needs:

My line is not described in the form y = ax + c (so I'd have to translate it, which is easy to do, but it means the process is slower). What if a is infinity ie. a vertical line?

Is there a simple way to calculate (x', y'), the reflection of point (x, y) in a line, where the line is described by the two points (x1, y1) and (x2, y2)?

Edit:

I've found a formula which does this, but it seems as though it does not work with lines that look like they have equation y = x.

Here it is in actionscript:

public static function reflect(p:Point, l:Line):Point
{
// (l.sx, l.sy) = start of line

[Code]....

View 2 Replies

ActionScript 3.0 :: Clone A Flv Video For Use As Reflection?

Feb 4, 2009

i am using 2 instances of an flv, and as you would expect they arent sync'd.so how do i 'clone' an flv in AS3 so that they are exactly the same?i have seen an example, but it was AS2, i am working with AS3, cs4..[URL]

View 5 Replies

3D Carousel - Reflection Not Working Correctly

May 24, 2009

So I followed the 3D Carousel tutorial, the first part of it and the coding worked fine, but the reflection is not working properly. I used a .PSD file and followed the instructions step by step. I added the action script code in the end, but when I take a look at the preview, the reflection image is displayed just like the original picture. Is the .PSD format a problem?

View 1 Replies

Carousel Remove Reflection Off The Icons?

Aug 15, 2009

Does anyone know how to get rid of the reflection off the icons in the carousel?

View 3 Replies

ActionScript 2.0 :: Create A Scroller With Reflection?

Dec 27, 2006

i'm trying to create a "reflection" to scrolling text.i'm using a nice little scroller code that works very well on it's own. i thought just duplicating the movie clip and mirroring it would do the trick, but instead only the "reflection" bit is moving up and down, the rest of the items stay put.

i thought it might be a matter of changing instance names, but then the "reflection" is the same object, just mirrored vertically, so i'm not sure how one should go about doing this...i'm attaching both the FLA and SWF files...

View 3 Replies

ActionScript 3.0 :: Bouncing Image With Reflection?

Sep 19, 2009

I have an image and I want it to have a reflection and to apply an effect onMouseOver so that image bounces (like a rubber ball) until it stops.I found this example (http:url]....)that does exactly what i want (except I want it to bounce just one time per mouse over), but this is for Flex and I cant manage to translate it to Flash.

View 2 Replies

ActionScript 3.0 :: Adding Reflection To Thumbnails Loaded From XML?

Feb 12, 2011

I have a .fla which loads thumb nails and when clicked shows the large image. It all works fine. I would like to have a reflection for each thumb how would I go about doing this, or how would amend my code to add the reflection.

Code:
var holder:thumbNail = new thumbNail();
var thumb:Loader;
var container:MovieClip = new MovieClip();

[code]...

View 3 Replies

ActionScript 1/2 :: Provide A Reflection For The Images (movieclips)?

Jun 10, 2009

I am trying to provide a reflection for the images(movieclips) that I loaded on the stage. For this purpose I am using a reflection class. The class can be used with action script 2. the reflection is working finely. Also after loading the image or movieclip, I tried to give tweening for that image or movieclips. Thus also it works finely. The reflection of that also moves along with the actual image. The problem comes with the resizing the actual image. If I resize the actual image, the reflection would not be seen under the actual image.Can anybody know why it may happening like that. After searching for a long time, I got this class.But unfortunately, the reflection would not be working when the image or moviclip resizes.

View 8 Replies

ActionScript 3.0 :: Reflection On Constructor Parameters (describeType)?

Jun 1, 2010

I'm working on a very simple dependency injector, reflecting on a types constructor parameters.But when ever I use the describeType on my custom classes, all I get in the constructor packet of the returned XML is something like this:

<constructor>
<parameter index="1" type="*" optional="true"/>
</constructor>

[code].....

View 1 Replies

ActionScript 1/2 :: Runtime Image Reflection Not Working

Feb 3, 2011

I'm trying to create an image reflection at runtime, using this code I found on the WEB. It all seems to work fine as long as I'm loading an image from the local drive, but when I try loading an image from a remote server, the reflection no longer appears.[code]

View 13 Replies

ActionScript 3 :: Flash - Reflection On Static Members?

Apr 3, 2011

Is there a way to "reflect on" static members of an ActionScript object (get all the static properties/methods of that type programmatically)?

Why is that flash.utils.describeType(*) can only show non-static members?

View 1 Replies

Flash :: Find Radians Reflection Angle?

Apr 29, 2011

What I've done so far is using your mouse you (click & release) you shoot a ball off in that direction using radians. Now what I'd like to happen is when the ball hits the wall it bounces off in it's reflection angle. Eg. if the ball hits the right-hand-side wall travelling at in a radians of -0.65 it should bounce back in the radians of about -2.5

View 3 Replies

Flash :: Reflection Bitmap Not Loading On Page?

Nov 20, 2011

I have a image loaded in a sprite, the image is from a remote location [URL]. Once the image is loaded in the Loader Object i then want to create a reflection of the sprite that contains the image. Now this works when i run the application in flash IDE but when i embed this flash application inside a HTML page the reflection images do not work. Why is this, the code is below.

////////////////////////////////////////////
// Project: Flash 10 Coverflow
// Date: 10/3/09
// Author: Stephen Weber
////////////////////////////////////////////

[Code]....

View 1 Replies

ActionScript 2.0 :: Rotate Towards Mouse W/ Boundaries And Reflection?

Oct 20, 2003

I'm using the code 'rotate towards the mouse' from [URL].. It works fine to rotate the clip, but there's two things I'd like to have happen here: 1. At a certain angle of rotation, the MC that is following the mouse reflects horizontally. example: a profile of a head is following the mouse. i don't want the head to be upside down when the mouse reaches the back of the head, but rather the head flips over to watch the mouse.

2. Boundaries: is there some way to set up the code so that the MC stops following the mouse when it reaches a certain position on the Y-axis?

View 3 Replies

ActionScript 2.0 :: Mouse Pointer Reflection On Surface

Mar 20, 2004

I'm working on a new site: [URL]. However, I've got some problems with my reflection of the mouse-pointer. The problem is that I don't know how to create the fake 3D effect, because now when you move your mouse over "Identity" the reflection is above the real mouse. I was thinking to put a mask, so the reflection cannot go above the real mouse, but then there is no reflection.

View 14 Replies

ActionScript 2.0 :: Moving Text In 3d Space With Reflection?

Jul 5, 2003

Anyone know of any dececent tutorials on mvoing text through '3d space' with a reflection? Im trying to look for an example to show you what I mean..

View 14 Replies

ActionScript 2.0 :: Make Reflection Effect For Movieclip?

Jun 1, 2008

how to make reflection effect for movieclip?

View 4 Replies

ActionScript 3.0 :: FIVe3D Reflection/gradient Effect?

Dec 21, 2009

create a reflection of the rounder corners rectangle. I realized thet there in no beginGradientFill method in Graphics3D and the gradientHorizontalPlain creates a basic rectangle without rounded corners. Also, I doesn't look like I can use masks in 3D (at least I failed trying it).All I could do is just create a semi-transparent rectangle under, but with no reflection (fading out) effect:[URL]

View 1 Replies

ActionScript 2.0 :: Rotate Towards Mouse With Boundaries And Reflection?

Oct 20, 2003

I'm using the code 'rotate towards the mouse' from [URL]

It works fine to rotate the clip, but there's two things I'd like to have happen here:

1. At a certain angle of rotation, the MC that is following the mouse reflects horizontally. example: a profile of a head is following the mouse. i don't want the head to be upside down when the mouse reaches the back of the head, but rather the head flips over to watch the mouse.

2. Boundaries: is there some way to set up the code so that the MC stops following the mouse when it reaches a certain position on the Y-axis?

I'm using Flash MX or MX 2k4, whichever is more convenient for this project.

View 3 Replies

Actionscript 3 :: Reflection - Reflect Swf/swc For Class That Implements Interface?

Apr 29, 2011

Not sure if this is possible but I would like to reflect a swf or swc file selected by the user at runtime to find any classes that implement a certain interface. Can this be done or do you actually need a reference to the class you want to reflect using describeType();

Note - this would be done in actionscript.

View 1 Replies







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