Q for Flex

Flex, how would i make a character who can move side to side and can jump, shoot something and an action occuring. In this case, character A shoots something at Character B, i want an action to occur.
How would i use the Hit.Test method in this case, or with any other method. :-\

Have you checked my site for the running and jumping character? What can you do so far? I can tell you what to add or change etc.

Have you come up with anything?

The other method is tile based - which can reduce the speed of the game - go to www.edmack.com - for a pros and cons list of tile based and art based games.

Are you using one platform, multiple platforms, are you talking about just one level - ie no platforms, side view, overhead view, etc.

If you’re not using tiles, then the ground, or platfrom would be a movie clip to hitTest - so when you jump - when you come down - you keep falling till you hit the ground or platform. But if you have multiple platforms, then you are always falling - unless you have a platform beneath you.

As for the bullets - you need to determine the direction the character is facing then attachMovie or duplicateMovieClip to fire in that direction. And you need to know if you have one bullet at a time, multiple bullets, can you keep the fire button held down etc.

And you need to develop random movements or some sort of decent AI (artificial intelligence) for the enemy or enemies.

You can use _root.plater_x or y to determine where they should face or shoot etc.

Like I said let me know what you have so far.

Here you go Flex, all i have are my two characters and nothing else. From the basics I guess. Don’t be surprised at my lack of actionscripting skills. Any help is appreciated. :smirk:

    There are a two actions such as shoot and stand. Two characters, the second has no actions. It will be a floating character, so there doesn't need to be a gravity effect.  Here is the FLA.

I’ve been playing with the fla - I’ll see what I can do…

Haven’t had that much of a chance to do anything with it - but this is what I have so far


Nice :stuck_out_tongue:


By the way - I’ve added it to the instructions on the swf now. I forgot to mentio to press Up to jump - but it does jump - press Up.

*Originally posted by flex *
**Haven’t had that much of a chance to do anything with it - but this is what I have so far

http://flex.funkyolive.com/test/gameproject.demo.html **

Excellent stuff!

Any chance of getting the fla file??

That’s Great Flex ! Almost like you read my mind. Thanks for the help! As you noticed, I only finished the helmet of the other character :smirk:

Anyone know where i can find a way to get the enemy to be 2nd player, a two player game?

Just give him diff controls to the first one. Look on my site a simple maze game where two players compete.

*Originally posted by cybergold *
**Anyone know where i can find a way to get the enemy to be 2nd player, a two player game?
:slight_smile: **

You still want my help or… Or have you got the hang of things now?

Do you think you could send me the actions and the fla. you worked on :stuck_out_tongue: I still don’t know that much AS. So that i can copy what you had for first player, and use those actions to make the second player. the walking/jumping character in your website is not downloadable. But overall thanks for the help.

I don’t mind sending the fla - I do it for people all the time - but when you say copy the code for the other player - I’d rather you understood the code or how to do it and then applied it to the other guy. You won’t really have an idea of what’s what in the code just by looking at the fla.

Sorry:o Must have mislead you. I will ofcourse study the AS. That’s the only way i can re apply it to other movies i have. If i wanted to just copy/paste the info, i wouldn’t have gone through this much trouble. :-\ I’m hoping to really learn AS and get a good hang on it. :smirk:

can you send up the fla?

what actions go along with the IF. and ELSE. options in the actionscript, what do they do? If i put in a variable for example… chA=10 , would i be able to say _x=chA+1 (is this how i would get the instance to move a couple of pixels?)

I’m sorting through the flas I have, and tidying up the code I did for you. There is a tut on this site for making an mc move with keys. This how I do it anyway:

on the mc:

onClipEvent (load) {
speed =5;

onClipEvent (enterFrame) {
if (Key.isDown(Key.LEFT)) {
_x -= speed;
} else if (Key.isDown(Key.RIGHT)) {
_x += speed;

That is the simplest way to move the mc, left and right. But you need to add to it to restrict movements so it doesn’t go off stage. And for animations for facing different directions, shooting etc.

There’s no point me going through the code here - it’s all in the fla - I’ll try and comment it as best I can then post it.

EDIT and tip: Putting else’s in certain places can also restrict movement of character - restricting diagonal movement for example.