The McLeodGaming forums were permanently closed on April 30th, 2020. You are currently viewing a read-only archive.
View unanswered posts | View active topics It is currently Fri May 15, 2020 5:40 am

Forum rules


IMPORTANT

This Forum is for Flash related questions ONLY! Do not ask questions about spriting, Game Maker, Photoshop, or anything else not related to Flash.



 [ 4 posts ] 
[Resolved] Flying Characters(off stage) 
Author Message
User avatar

Joined: Fri Mar 27, 2009 8:55 pm
Posts: 282
Location: Why do you want to know you perv!
Gender: Male
Skype: lomeli1241
Currently Playing: Kingdom Hearts Re:Coded (JP)
Okay, I'm working on a Super Smash Bros. game (as you can see from my signature) . So far I got most of the scripting down, but I can't get the characters to fly off and the distance at which they fly off the stage. Can some one, I don't know, HELP?!!! (I'm using Flash Pro. 8 and ActionScript 2.0)

_________________
Image
Image
Give cred 2 Doromac
Mes Amis: show
BICURIOUS GEORGE
daniel
King Master X12
Neo_Fire_Sonic
Racerx52
Sora
Tycron
Tyli
User Avatar
yoh
Envoyez-moi un message pour ĂȘtre mon ami! Ha! That's French 4 Pm to be Friends


Tue May 19, 2009 3:56 pm
WWW
User avatar

Joined: Mon Aug 11, 2008 1:09 pm
Posts: 166
Location: England lol
Gender: Male
Currently Playing: Minecraft
Well without looking at your code and your physics engine, I'd just say you need to figure out an effective way to invert the characters gravity, making them fly upwards at a certain speed, just like throwing a ball into the air it will eventually fall back down and if your gravity is set to do this then it will look realistic. I'm guessing you already have a jumping feature that you can just do the same with.


Thu May 21, 2009 9:31 am
WWW
User avatar

Joined: Mon Aug 11, 2008 6:56 am
Posts: 469
Location: not so superhappy fun fun land....
well, just like X2I said, you can use the code you used for jumping.
an example:
if you usedX2I's code to make your guy jump, here's how he did it:
Code:
onClipEvent(load) {
isJump = false;
}
onClipEvent(enterFrame) {
gravity++
this._y += gravity
if (Key.isDown(Key.UP) && isJump = false) {
gravity -= 13
isJump = true
this._y -= 5
}
}

then add the code for the ground he had.
now, when you press UP, your character jumps.
NOW here's how we can use it to make the enemy fly back.
Code:
// first, we need to add stuff to your code
onClipEvent(load){
// keep the stuff you already had in here
}
onClipEvent(enterFrame) {
gravity++
this._y+=gravity
// same as before but add this to your code:
if (this.hitTest(_root.guy'sattackvariablegoeshere)) {
gravity -= 13
this._x -= 15
this._y -=5
}
}

now, as we see, I took the code to make the character jump and added makeing him move left to make him get knocked back whe hit by your attack. try it out and tell me if there is a problem.

_________________
Image

ashante08 wrote:
We argue, we try to understand each of our problems, we argue some more, rinse and repeat


Wed May 27, 2009 3:09 pm
User avatar

Joined: Fri Mar 27, 2009 8:55 pm
Posts: 282
Location: Why do you want to know you perv!
Gender: Male
Skype: lomeli1241
Currently Playing: Kingdom Hearts Re:Coded (JP)
Thank you, this has been keeping me up at night. :bump:

_________________
Image
Image
Give cred 2 Doromac
Mes Amis: show
BICURIOUS GEORGE
daniel
King Master X12
Neo_Fire_Sonic
Racerx52
Sora
Tycron
Tyli
User Avatar
yoh
Envoyez-moi un message pour ĂȘtre mon ami! Ha! That's French 4 Pm to be Friends


Mon Jun 15, 2009 5:17 pm
WWW
Display posts from previous:  Sort by  
 [ 4 posts ] 

Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

cron
Powered by phpBB® Forum Software © phpBB Group
Designed by ST Software for PTF.