To register for an Internet.com membership to receive newsletters and white papers, use the Register button ABOVE.
To participate in the message forums BELOW, click here


A Flash Developer Resource Site

Go Back   Flash Kit Community Forums > General Help > Games

Closed Thread
 
Thread Tools Search this Thread Display Modes
Old 02-27-2004, 10:55 AM   #1
stillfunny2u
GoldMember
 
Join Date: Feb 2004
Location: Chicago
Posts: 78
help w/ ACTUAL MOVING Character Control (UP, DOWN, LEFT, RIGHT)

I understand:
  • how to make a movie clip jump to a position on a key movement
  • how to make a movie cilp jump to another spot when it rolls over another mc. eg a boat over a wave
but I am looking for something a little more. I would like it to be:
  • When you press up, down, left, or right, rather than have the mc "jump" to a specific spot.
  • when the charachter mc goes over a "wave" mc, it "moves" (not jumps) the charachter movieclip in a certain direcion.
Could I use a tween, an acionscript for movement (ir there is one)? I have tried many things, but it gets ever so complicated. Please help!!
Here is a short summary of the game:
  • the charachter moves around w/ the (up, down, left, right, ) keys
  • when the charachter mc (the boat), goes over a "wave" mc, the boat should push the boat a little distance
  • If you have ever played the little puzzle in pokemon red/blue, where you walk around, and certain tiles move you up down left right, this is exactly lke that
  • and No, I dont play pokemon anymore! Just my little brother does!
If you would like the file, please email me.

Last edited by stillfunny2u; 02-27-2004 at 11:42 AM.
stillfunny2u is offline  
Old 02-27-2004, 11:05 AM   #2
Ihoss
Guest
 
Posts: n/a
Quote:
and No, I dont play pokemon anymore! Just my little brother does
lol, we belive you

i asume you know what the _x and _y variable does, and what +=5; does. if you want the boat to move when you press a key, just use this:
code:

_x+=5;
//or
_y+=5;



then just use those for the key and when the wave hits it

good luck, and welcome to Flashkit
 
Old 02-27-2004, 11:12 AM   #3
stillfunny2u
GoldMember
 
Join Date: Feb 2004
Location: Chicago
Posts: 78
Thie is what I have for my actionscript on the boat:
onClipEvent (enterFrame) {
//when the user presses 'up', the boat goes up
if(Key.isDown(Key.UP)) {
if(direction=="up"){
this._y -=36;
}
else {
this._rotation=0
direction = "up";
}
}
// added _rotation modifier- so it looks like it is going up or down when you press the arrows
//when the user presses 'down', the boat goes down
if(Key.isDown(Key.DOWN)) {
if(direction=="down"){
this._y +=36;
}
else {
this._rotation=180
direction = "down";
}
}

//when the user presses 'left', the boat goes left
if(Key.isDown(Key.LEFT)) {
if(direction=="left"){
this._x -=36;
}
else {
this._rotation=270
direction = "left";
}


}

//when the user presses 'right', the boat goes right
if(Key.isDown(Key.RIGHT)) {
if(direction=="right"){
this._x +=36;
}
else {
this._rotation=90
direction = "right";
}
}

}



This is pretty much what you have, exept mine has
this._x, not _x;. I want the user to be able to tap up, then have the boat, MOVE, up, not just go "dun!" and make it just jump.
Attached Files
File Type: fla minigame.fla (23.0 KB, 6 views)
stillfunny2u is offline  
Old 02-27-2004, 11:50 AM   #4
Ihoss
Guest
 
Posts: n/a
that is a frame rate problem you have there. -36 is quite a lot, and i guess you have the standard frame rate of 12. change the frame rate to 30 or 40 and the _x+=5. then it will look smoother.

Edit: aha, tilebased. forget what i said. i think tonypa has some stuff on this. i came up with a way to do it though:
 
Old 02-27-2004, 12:05 PM   #5
stillfunny2u
GoldMember
 
Join Date: Feb 2004
Location: Chicago
Posts: 78
i mean, maybe on the first frame have a movieclip, then have a tween. then when you press up, it plays the movie moving the movieclip? but how could it move to a different spot each time? I want the mc to move to _x+36, not just in an instant be there.
stillfunny2u is offline  
Old 02-27-2004, 12:07 PM   #6
Ihoss
Guest
 
Posts: n/a
here is the upload:
Attached Files
File Type: fla minigame.fla (29.5 KB, 22 views)
 
Old 02-27-2004, 12:26 PM   #7
stillfunny2u
GoldMember
 
Join Date: Feb 2004
Location: Chicago
Posts: 78
THANKYOUTHANKYOUTHANKYOUTHANKYOUTHANKYOUTHANKYOUTH ANKYOUTHANKYOUTHANKYOUTHANKYOUTHANKYOUTHANKYOUTHAN KYOUTHANKYOUTHANKYOUTHANKYOUTHANKYOUTHANKYOUTHANKY OUTHANKYOUTHANKYOUTHANKYOUTHANKYOUTHANKYOUTHANKYOU THANKYOUTHANKYOUTHANKYOUTHANKYOUTHANKYOU
stillfunny2u is offline  
Old 02-27-2004, 12:33 PM   #8
Ihoss
Guest
 
Posts: n/a
ANYTIMEANYTIMEANYTIMEANYTIMEANYTIMEANYTIMEANYTIMEA NYTIMEANYTIMEANYTIMEANYTIMEANYTIMEANYTIMEANYTIMEAN YTIMEANYTIMEANYTIMEANYTIMEANYTIMEANYTIMEANYTIMEANY TIMEANYTIMEANYTIMEANYTIMEANYTIMEANYTIMEANYTIMEANYT IMEANYTIMEANYTIMEANYTIMEANYTIMEANYTIMEANYTIMEANYTI MEANYTIMEANYTIMEANYTIMEANYTIMEANYTIMEANYTIMEANYTIM EANYTIMEANYTIMEANYTIME









just not tomorrow...
 
Old 02-27-2004, 12:36 PM   #9
stillfunny2u
GoldMember
 
Join Date: Feb 2004
Location: Chicago
Posts: 78
just one tiny little problem, how do i know whats going on so that I can edit it, like if I wanted to make more waves?
stillfunny2u is offline  
Old 02-27-2004, 01:02 PM   #10
Ihoss
Guest
 
Posts: n/a
what is it you dont understand? just so its easier to explain (it wasnt meant to be rude )
 
Old 02-27-2004, 01:39 PM   #11
ArrowFlash
Senior Member
 
Join Date: Jan 2004
Posts: 366
Quote:
Originally posted by stillfunny2u
just one tiny little problem, how do i know whats going on so that I can edit it, like if I wanted to make more waves?
Just a quick question did you just copy and paste that code or did you actually write it out?

And I cant really say how to add more waves without actually knowing how you make waves in first place. You only posted the movement code.
ArrowFlash is offline  
Old 02-27-2004, 01:47 PM   #12
stillfunny2u
GoldMember
 
Join Date: Feb 2004
Location: Chicago
Posts: 78
These are my questions:[list=1][*]What does the "s" variable do?[*]How did you change it to "xs" and "ys"?[*]What does the "pos" variable mean?[*]If I wanted to add more "waves", how would I do so? (I guess I probably could figure that one out myself, if I understood how it all worked)[/list=1]
Just for some background info, this is going to be used for a puzzle in a game I am making. The game is a rpg/puzzle game inspired by Myst, Mystery of Time and Space (MOTAS), and The Curse of Monkey Island.

When I finish the entire game(which at the rate I'm going, will be when I'm 60), I will post it in the forums.

One more thing, if you don't want to answer this you don't have to:

What kind of position are you in that you can just be on your computer all day long, answering requests like mine?
(believe me, I would die for that life )

Oh yeah, one more "one more thing", Thanks again, for all that you have done to help me!!
stillfunny2u is offline  
Old 02-27-2004, 01:51 PM   #13
stillfunny2u
GoldMember
 
Join Date: Feb 2004
Location: Chicago
Posts: 78
HeyArrowFlash, copied and pasted that, but I did not use the "click and drag" method to write it, it just takes too long.

Last edited by stillfunny2u; 02-28-2004 at 09:13 PM.
stillfunny2u is offline  
Old 02-27-2004, 02:07 PM   #14
ArrowFlash
Senior Member
 
Join Date: Jan 2004
Posts: 366
excuse me I didnt see it was attached. do0tn be a jack***.
ArrowFlash is offline  
Old 02-27-2004, 02:35 PM   #15
tonypa
Moderator
 
tonypa's Avatar
 
Join Date: Jul 2001
Location: Estonia
Posts: 8,138
Hey, hey, no need to be rude

You can always use "edit" button if you have made mistake in your post. Or delete the post altogether.
__________________
My games, Tile based tutorials, Vectors, Latest finished game Ononmin
tonypa is offline  
Old 02-27-2004, 02:41 PM   #16
stillfunny2u
GoldMember
 
Join Date: Feb 2004
Location: Chicago
Posts: 78
In these forums you cant tell when somebody is joking! Hey I'm sorry {COLOR=blue]Arrowflash[/color]. .

Last edited by stillfunny2u; 02-28-2004 at 09:15 PM.
stillfunny2u is offline  
Old 02-27-2004, 02:58 PM   #17
Ihoss
Guest
 
Posts: n/a
calm down guys, no name calling here

1) the s variable is the speed you want the boat to move at. thei higher it is, the faster the boat moves, but the more it "jumps"
2) it wasnt hard chanign it to xs and ys
3) pos is just for checking if the boat has traveled far enough. there are 36 pixels between one tile and the next, so when pos==36, it is at the next tile and the moving should be stopped.
4) good question. i would sugest using a 2d array and learning tilebased game making. hunt down tonypa for that
 
Old 02-27-2004, 03:00 PM   #18
stillfunny2u
GoldMember
 
Join Date: Feb 2004
Location: Chicago
Posts: 78
you've answered all of my questions, but what I meant by #2 was, what does xs and yx mean?
stillfunny2u is offline  
Old 02-27-2004, 03:03 PM   #19
Ihoss
Guest
 
Posts: n/a
xs and ys is the speed and the direction controler. if xs is positive, it will move to the right and if it isnt, it will move to the left. if ys is positive, it wil move down, and if it isnt, it will move up.
 
Old 02-27-2004, 03:06 PM   #20
stillfunny2u
GoldMember
 
Join Date: Feb 2004
Location: Chicago
Posts: 78
for the last time thank you,

Last edited by stillfunny2u; 02-28-2004 at 09:17 PM.
stillfunny2u is offline  
Closed Thread

Go Back   Flash Kit Community Forums > General Help > Games

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 05:41 PM.


internet.commerce
Be a Commerce Partner
 »  »  »  »  »  »  »
 »  »  »  »  »  »
 

    

Acceptable Use Policy


The Network for Technology Professionals

Search:

About Internet.com

Legal Notices, Licensing, Permissions, Privacy Policy.
Advertise | Newsletters | E-mail Offers


Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.