ActionScript 3.0 :: 2D Character Movement With Camera Movement
Jun 10, 2011how to get the camera to move with a character? At the minute he just moves off screen when i press right rather than the camera following him.
View 3 Replieshow to get the camera to move with a character? At the minute he just moves off screen when i press right rather than the camera following him.
View 3 RepliesI have a 9 frames image of a character.In other language generally i used to make character animation by looping the array consisting of different frames and drawing each frame when pressing key.What i want to do is when i press left or right key, i want to draw each frame that makes character movement and update x coordinates of frames, and it will appear as character is moving.
View 4 Repliesactually i want to create this kinda effect which i'm using for my own blog... i'm not a programmer, i'm a designer but i do know 30% of actionscript 2.0
here what i want to achieve is showing in the attached document
camera-work.jpg (24.29 KiB) Viewed 1996 times
I am trying to make a flash website in which users navigate around a 3D model scene to access the content of the site. Is this even possible? I've scene other sites do this but I'm not sure if it's video or 3D. If so I could really use some help with camera movement in response to button clicks.
View 1 RepliesI am a newbie in Flash ActionScript. I am trying to capture an image using webcam via Flash. I managed to do this but I have encountered a problem in which: When I moved my head to the right, the video in Flash is showing that my head is moving on the opposite direction.
guess to be clearer:
Try on Facebook and click "add photos/videos" on the status update.
Click on "Use Webcam" and allow webcam.
You'll notice that when it is in "video" mode, when you move your head to the right, the screen will show that your head is moving in the opposite direction.
Now, click on the icon on the top right to switch to "photo" mode. Now, when you move your head to the right, the screen will show that your head is moving to the right as well!
Ive been looking at the following tutorial: [URK] but i can't seem to get it to work. If anyone has completed this tutorial, is there any chance of you uploading the fla for me to play with...?? Im trying to use the Star/Space effect located at the bottom of the page.
View 2 RepliesI'm developing a flash application. I am looking for a simple way to animate my camera's movement. Is there any built in tweening library that supports the camera object? I've checked out greensock.com, but I couldn't figure out how to use their libraries for the camera object.
EDIT: by camera I mean the viewing perception. Not a real hard drive web camera.
I am just starting with 3d flash concepts and I was checking this tutorial:[URL]I wonder if there is a tutorial showing the same movement but with a solid cube. I fact, what I want to achieve is this effect:[URL]
View 2 RepliesRight now I have all the animations for each direction in a movieclip within one movieclip.However, when I use the arrow keys to move the walking animations don't playWhen I stop, the appropriate animations play, however. Here is my code:
Code:
onClipEvent (load) {
facing = 1;
[code]....
i have made the movie clips for my character walking in 4 different directions but i have no idea how to make it so when the up arrow key is pressed, for instance, the movie clip of my character walking up is played.
View 7 Repliesmy movement script looks like thisActionScript2.0)
[Code]....
I'm sorry if this is the wrong section. But I'm looking for help with my actionscript coding. I'm fairly new to Flash. I've only scripted some simple websites so far and this is the first time I try to make a flash game. I started yesterday but I'm already having problems with my script.
I have a scene with 2 layers: one with my character and one with the bounds (ground, ceiling and walls).
Inside my character movie clip, I have this: Which is basically a bunch of frames labeled and with the action to stop();. Each one containing another movie clip with the respective animations. So the idea was, when I press "A", jump to "walk left". And it kinda worked, but I have some problems and I'm not really sure how to solve them.
[Code]...
1. Character Movement: as you know the iPhone/iPod touch doesnt have any sort of keypad and so when creating a game that has character movements onscreen buttons need to be used. My question is this; how exactly do i make it so that when the player taps/holds down a button (is the same as mouse clicking it) my character moves.
2. adding a physics style fall: once i have created this movement using on screen buttons i now need to create a jump, so what i need is something so that when the player clicks the "jump" button the sprite moves up a certain amount and then stops moving up and falls down.
I'm doing a simple game where you move the character using the arrow keys and shoot using the Mouse. The character rotates based on the Mouse angle. I have two problems: when I move the character, he moves once, then stops then moves again as normal. My other problem is that when I click over a MovieClip, the bullet goes to the wrong angle.My moving function:
Code:
stage.addEventListener(KeyboardEvent.KEY_DOWN, keyHandler);
function keyHandler(event:KeyboardEvent):void {
[code]....
I am designing a character to move right and left but the character is not recognising the floor movieclip and is falling straight threw the floor.I have attached a zip file with the flash document sample and associated Actionscript file.
View 2 Replies1. How do I prevent my scuba diver from leaving the screen? As when i hold either up, down, left or right long enough he will leave the stage entirely.2. How can I make my sharks enter the screen at random rather than having them enter from the same position each time? Here is my code:
(FOR MY SCUBA)
onClipEvent (load) {
xspeed = 10;
[code].....
I want to make my character moves randomly that is character will base on random numbers(for example generate 4 random numbers) and character's favorite(for example fast food, west food, Chinese food) to move. The character will move randomly with 4 direction that is move up, move down, move right and move left(any speed will do). Should i have four function with four movement.
View 1 RepliesI have a MC which is a lady that raises her arms up and down. From the main timeline i want to tell that "ladyMC" (also sitting on the main timeline) to play to and stop on specific frames. I have tried it two different ways but am obviously missing something. The first way i tried just using an if/else and getting the current frame #.
Code:
if(lady._currentframe < 22){
lady.play();
[code]....
I've been playing with carousel code, and was wondering how to change it from circular animation (carousel) to left/right linear (conveyer belt) style animation, how to change the mover code and 't.angle = i * ((Math.PI*2)/numOfItems);'
[Code]....
i want a character to move on a globe. the movement of the character is shown though not by shifting the positions of the caharcter but by the rotation of the surface of the globe. buttons are used to move leftward and rightward.
Also, there are three layers of the globe to show depth. how would i script it so that the layers of the globe rotate at different speed?
i've uploaded a zipped of a fla file.
Right basically I have a character and a background. The background scrolls as you press left or right on keyboard to create the illusion of movement. I want the character to flip when you change from holding down left to right and vice versa, but when I do the following code it doubles the size of the character once and then it stays. It flips fine but in the transformed fat size.
Here's the code:
var mySpeed:Number = 10;
function keyIsDown(evt:KeyboardEvent):void{
if(evt.keyCode==Keyboard.RIGHT){
walkingPlane_mc.x+=mySpeed;
greyCharacter_mc.scaleX=-1;
[Code] .....
I have a mc (fStrip) which looks like a piece of filmstrip with thumbnail images in it. I want this mc to move when the users mouse is positioned over it, but I only want it to move only along it's x-axis and in a direction opposite that of the mouse. And I want it to move or flow smoothly.
I've been trying to figure this out (see my lame attempt below) but without much luck.
onClipEvent (mouseMove) {
buffer=20 //movement buffer
mousePos=_root.fStrip._xmouse //store mouse position
if (mymouse!=_root.fStrip._xmouse){ //if the mouse has moved
[Code].....
I wish to get the effect of ants scuttering across the screen or up a tree, I have not decided which direction yet. I started with the tutorial code for the snow effect from kirupa, and changed it around to fit the little vector ant I created. The way I have it now looks pretty good, but the movement is a little too fluid. They obviously move in sinusoidal paths bc the code tells them to. I have about 20 copies of the main obj, and they're all a little different in size and specs (speed, transparency, etc) but what I was wondering was if there is any way I can change the code to make it a little more hectic, or erratic, not so fluid. If there is no way of doing so, it looks pretty good right now. If there is, however, I think it could look awesome. here's the code I'm using for the object.
onClipEvent (load) {
//stage
movieWidth = 850;
movieHeight = 50;
[code]....
RIGHTNOW, Im doing my game development but I have problem based on my game control.this is my question..
I have two frames. the first frame is on running movement of the character and the second frame is on standing position.This two frames has only one kind of character,but I seperated the two movement in two frames witch are running and standing positon.my problem is how can I do the mouseEvent,if onclick the character will continue on running and if on release the character will do is to standing position.
am pretty new to Kirupa and Flash. I have a little problem, concerning a character hitting a wall. What i have: a char that can jump and move around by the arrow keys. What i need: character shall stop movement if he hits a geometry. But being able to start movement again, besides through the geometry. I'd like to reach this with gskinners CheckForCollision class. Have a look here: [URl] But i didnt manage my code to get it work. So maybe you could leak me some information on how to get this done. Heres my code so far:
[Code]...
edit admits: so far i have a character mc called "player" and one called "level". i would apply the code to the player, and it would be cool to have the possibility to check collision of the player with multiple MCs, not only the level.
sample codes. In those codes they are using a verticalChange variable for the time-based character movement.But I can't figure out how this code works and why we needthose calculations - char.dy*timeDiff + timeDiff*gravity?So here is the code:
Code:
// assume character pulled down by gravity
var verticalChange:Number = char.dy*timeDiff + timeDiff*gravity;
[code]....
I have a Mogli (Junglebook-like) Character that i got to move with the arrow keys on the keyboard.
I want the character to jump (so for example , he must while moving to the right of the "gamearea" , you must be able to hit a key (say for example the "control" key ) and then the character must jump ( go up ) and as soon as the key is released he must obviously come down.
And also how do one set movement speed on any particular movement.
im making a platform game at the moment and i need for the screen to follow the character, at the moment i've got the code on the background symbol and all the baddies in that symbol so when you press the arrow key the symbol moves to the side the code i have on this is
onClipEvent (load) {
walkSpeed = 2;
}
onClipEvent (enterFrame) {
if (air == true) {
[Code]....
if anyone knows a way to put this on the camera
I have a project in flash. The most simple part of the animation renders horribly. I am trying to get the animation of the year 2009 in letters that occupy most of the 500x500px screen to go from left to right. No extra movement. no twisting. nothing special. just sliding left to right. I tried making the file a bitmap, vector art, creating the actual image in flash. Everything comes in with lines through them in some places that come and go away as the image progresses through the screen. It also looks like the image stumbles a little but then keeps going, if you are really lucky, you'll be able to see a few lines running through the letters, but they dissapear right away. The is nothing interfering with the timeline, I have tried setting the fps rate from 12 to 30 to 60 to 120. It gets better but does not eliminate the problem. I tried reducing the image size down to small letter less then 1/5 of the screen, but still the problem persists. I really need the letters to be large on the screen and flow across smoothly. I also tried importing the file as a whole 2009, tried importing numbers seperatly 2, 0, 0, 9 and have them float, i tried making an object in flash that is not a number - but just a rectangle, it has the same problem.I also tried animating it in different ways - creating a starting keyframe and the last keyframe and creating a motion tween between them (the normal regular way). I tried placing a few keyframes in the middle and linking them all. I tried creating keyframes for every frame within the animation, which actually made it run the smoothest.
The file I included has just the 2 moving across the page at 120 fps, with a keyframe in every frame of the animation. I am starting to think that the rendering in not the issue of flash but rather of the lcd screen's refresh rate, video card and ram, as well as other mechanical factors. However the not-so-technical-clients need to be satisfied .
[Code]...
following codes are for making a "circle" move along all four edgesof the screen...but some codes are missing..please add some more codes so that my circle(MC) finish its journey..1..go right..2 go down..3 go left and finally go up...to where it first started...
onClipEvent (load) {
this._x = 10;
this._y = 10;
[Code].....