Forum Topic: Need help on actionscripting...

(398 views • 16 replies)

This topic is 1 page long.

<< < > >>
None

assassingao

Reply To Post Reply & Quote

Posted at: 10/6/05 05:44 AM

assassingao EVIL LEVEL 04

Sign-Up: 10/13/04

Posts: 64

I'll list the help I wanted...

1. Is there a code that make an object follows another object while it was facing another object

Example : The Zombie follows the player , but when player get to the zombie's back , it's walking
BACKWARD toward player , instead of turning around and follow the player...

2. How could I make the player shoot at the cursor ?

3. How could i make the enemies spawn ?

Either post the code here or post the tutorials...

There are more actionscript problems , but I will just post those three for now :)

I'm trying to do a bird-eye view shooting game here...


None

Toast

Reply To Post Reply & Quote

Posted at: 10/6/05 06:13 AM

Toast DARK LEVEL 09

Sign-Up: 04/02/05

Posts: 8,414

You're asking for a whole lot of code, you need to show us what you currently have, there must be hundreds of ways to make a shooter...

I put on my robe and wizard hat

Why don't you check out my check out my userpage?

BBS Signature

None

Inglor

Reply To Post Reply & Quote

Posted at: 10/6/05 06:33 AM

Inglor NEUTRAL LEVEL 17

Sign-Up: 01/26/03

Posts: 10,957

At 10/6/05 05:44 AM, assassingao wrote: I'll list the help I wanted...

1. Is there a code that make an object follows another object while it was facing another object

yes, but it requires trigonometry, cos and sin for the movement, tan for the facing.

Example : The Zombie follows the player , but when player get to the zombie's back , it's walking

read AS: Trigonometry

BACKWARD toward player , instead of turning around and follow the player...

same thing +180 degrees of rotation

2. How could I make the player shoot at the cursor ?

look into the atan2 function, again, trigonometry

3. How could i make the enemies spawn ?

dynamically? read AS: Duplicated MovieClips

Either post the code here or post the tutorials...

O RLY?

There are more actionscript problems , but I will just post those three for now :)

ok

I'm trying to do a bird-eye view shooting game here...

ok, good luck, go search the BBS for AS: Main and read duplicated movieclips, and trigonometry, also go to flashtroops.net , they have a great trigo tutorial


None

assassingao

Reply To Post Reply & Quote

Posted at: 10/6/05 06:34 AM

assassingao EVIL LEVEL 04

Sign-Up: 10/13/04

Posts: 64

I"m planning to do a game like Crimsonland...

Actually , I'm planning to do a flash version of crimsonland...

http://img18.imagesh..e=crimsonland3ek.swf

I Began making it today *sweatdrop*

That's what I got so far...


None

Inglor

Reply To Post Reply & Quote

Posted at: 10/6/05 06:37 AM

Inglor NEUTRAL LEVEL 17

Sign-Up: 01/26/03

Posts: 10,957

Sorry to discourage you :P but a flash version of crismonland has already been made, frontpaged, and awarded, that's how I heard of crismonland in the first place and later on bought it and beat it.

Still, good luck! I'd love to see your vision of the flash version, CL rox


None

assassingao

Reply To Post Reply & Quote

Posted at: 10/6/05 06:43 AM

assassingao EVIL LEVEL 04

Sign-Up: 10/13/04

Posts: 64

At 10/6/05 06:33 AM, Inglor wrote:

yes, but it requires trigonometry, cos and sin for the movement, tan for the facing.

Thanks ! I don't see your post , we post at the same time..

Oh , and where is the flash version of the crimsonland ??

4.How could I make the player pick up the weapon?
5.How could I make the traits actually do it's effects?
(If you have play Crimsonland , you'll know what I'm talking about...)


None

Inglor

Reply To Post Reply & Quote

Posted at: 10/6/05 06:47 AM

Inglor NEUTRAL LEVEL 17

Sign-Up: 01/26/03

Posts: 10,957

variables, intervals/clip events, and good AS structure, for the weapon it is a hitTest (unless telekinesis is obtained in which case it is a mouse distance check) and for the perks it is a variable check over a fixed interval.. this isn't easy to script, I suggest you start with simpler stuff

I don't remmember how the flash version was claled really... try in the where is / how to forum


None

assassingao

Reply To Post Reply & Quote

Posted at: 10/6/05 06:52 AM

assassingao EVIL LEVEL 04

Sign-Up: 10/13/04

Posts: 64

If I don't start simple stuff as those things , my brains gonna overload...

K , Thanks for the advice :)

Note : It's not only telekinesis that has to do with the mouse , pyrokinetic too...


None

Inglor

Reply To Post Reply & Quote

Posted at: 10/6/05 06:54 AM

Inglor NEUTRAL LEVEL 17

Sign-Up: 01/26/03

Posts: 10,957

yeah, but pyrotechnic is for the attack system, it doesn't obtain weapons and upgrades but only demages the enemies, it has to do more with duplicate movieclip of the fire and checking it against the enemy


None

assassingao

Reply To Post Reply & Quote

Posted at: 10/6/05 07:03 AM

assassingao EVIL LEVEL 04

Sign-Up: 10/13/04

Posts: 64

6. As you can see , I make the walking animation but it's activated AFTER you release the key , how could I fix this?

7. What is the code to make keyboard button 'W' walk instead of UP ARROW?

I tried
{ if (Key.isDown(Key.W))
{ _y -= 5; }}

But it doesn't work.......


None

Go0gley

Reply To Post Reply & Quote

Posted at: 10/6/05 07:32 AM

Go0gley LIGHT LEVEL 19

Sign-Up: 07/08/04

Posts: 218

At 10/6/05 07:03 AM, assassingao wrote: { if (Key.isDown(Key.W))
{ _y -= 5; }}

"Making up" your own code never works. Try...

if (Key.isDown(87)) {
_y -= 5;
}

Flash uses ASCII code, where 65 = A, 66 = B, 67 = C... (and +1 as you proceed though the alphabet) then you'll eventually get to W which is 87.


None

assassingao

Reply To Post Reply & Quote

Posted at: 10/6/05 07:40 AM

assassingao EVIL LEVEL 04

Sign-Up: 10/13/04

Posts: 64

At 10/6/05 07:32 AM, Go0gley wrote:
Flash uses ASCII code, where 65 = A, 66 = B, 67 = C... (and +1 as you proceed though the alphabet) then you'll eventually get to W which is 87.

Your post are really helpful , THANKS!!!


None

assassingao

Reply To Post Reply & Quote

Posted at: 10/7/05 02:22 AM

assassingao EVIL LEVEL 04

Sign-Up: 10/13/04

Posts: 64

Oh , there are more questions that aren't answered...

First of all , I could get the player to turned to the mouse...
But I can't get the zombie to turn to the player , but the zombie follows the player...

8. How could I make the cursor(movieclip) play itself when it was clicked?
9. How could I do hit test and make the varible 'health' decrease when zombie touches the player?
10. How could I make the player unable to walk outside the movie but the zombie can walk in ?
11.What is the duplicate movieclip command?
(I got an flash MX 2004 in the language I don't know because I don't found english version of flash MX 2004 for download...)

More will come...


None

Toast

Reply To Post Reply & Quote

Posted at: 10/7/05 05:49 AM

Toast DARK LEVEL 09

Sign-Up: 04/02/05

Posts: 8,414

At 10/7/05 02:22 AM, assassingao wrote: Oh , there are more questions that aren't answered...

First of all , I could get the player to turned to the mouse...

You need to use Math.atan for that, everything is explained
here.

But I can't get the zombie to turn to the player , but the zombie follows the player...

Assuming that the instance name of the hero is "hero", use this code(change it to the real instance name if it's not the same.
onClipEvent(enterFrame){
if(this._x > _root.hero._x){
this._xscale = 100;
}
if(this._x < _root.hero._x){
this._xscale = -100;
}

}

8. How could I make the cursor(movieclip) play itself when it was clicked?

Paste this code:
onClipEvent(mouseDown){
this.play();
}

9. How could I do hit test and make the varible 'health' decrease when zombie touches the player?

Put this code on the zombies(assuming that the player's instance name is "hero"...)
onClipEvent(enterFrame){
if(this.hitTest(_root.hero)){
health -= 5; // feel free to change it.
}
}

10. How could I make the player unable to walk outside the movie but the zombie can walk in ?

For that you will need to post your movement code here.

11.What is the duplicate movieclip command?

Using duplicated MovieClips by Denvish .

(I got an flash MX 2004 in the language I don't know because I don't found english version of flash MX 2004 for download...)

Many flashers could use any language, it's not really important since AS is 1 language.
What do you mean by download it? The only legal version costs money, you could be banned for posting that.


More will come...

OH noes!
I think you've already asked enough questions, you're barely started and already need help with 11 different things??? =p

Bah, anyways, add me if you have more questions(do so even if you don't =p)
darktoaster@hotmail.com

-Toast? :)

I put on my robe and wizard hat

Why don't you check out my check out my userpage?

BBS Signature

None

assassingao

Reply To Post Reply & Quote

Posted at: 10/8/05 03:16 AM

assassingao EVIL LEVEL 04

Sign-Up: 10/13/04

Posts: 64

Let me fix that , I meant I couldn't download flash MX 2004 TRIAL with english version...

Thanks you for your answers!!!


None

Toast

Reply To Post Reply & Quote

Posted at: 10/8/05 03:28 AM

Toast DARK LEVEL 09

Sign-Up: 04/02/05

Posts: 8,414

Do you have msn or AIM?
Aim in my profile and msn in my signature.

I put on my robe and wizard hat

Why don't you check out my check out my userpage?

BBS Signature

None

assassingao

Reply To Post Reply & Quote

Posted at: 10/9/05 12:58 AM

assassingao EVIL LEVEL 04

Sign-Up: 10/13/04

Posts: 64

For weapons and perks...

Could I use this code?

if pistrol == true <--- I really need help on this one... I don't know what is the correct code called...

shootchance += 5


All times are Eastern Standard Time (GMT -5) | Current Time: 11:35 AM

<< Back

This topic is 1 page long.

<< < > >>
You need a Grounds Gold Account to post on the NG BBS! If you don't have one, click here to sign up now! It's fast, free, and easy — and opens up tons of great NG features!