Is this possible?

Started by Blitzerland, Sat 11/06/2005 01:58:18

Previous topic - Next topic

Blitzerland

All, right, deep breath. Here goes.

I'm trying to do an action sequence in my game.

Would it be possible for a character to fire a projectile, and would it be possible for that projectile to do damage to another character when it came into contact with it?



How would I go about scripting that?

Gregjazz

An important question to ask is whether while the projectile is firing, you are able to fire another...

Ishmael

I made a projectile firing scene for a game of mine. Though, the idea was that only one projectle was on screen at once. In that setting, it worked well enough, and more projectiles would've caused just chaos on the players behalf...

But yeah, I could make on that fires several, not a big task (I think). The easiest way would maybe be using a character for each projectile.

But, if the projectiles being fired should be bullets, why should they be visible on the screen? If they are, you could just calculate if anything is in it's trajectory, and add the damage to them. This method has it's flaws, tough. If the projectiles are something like rockets or fireballs, the characters method ought to be the easiest, but perhaps not the most efficient one...
I used to make games but then I took an IRC in the knee.

<Calin> Ishmael looks awesome all the time
\( Ö)/ ¬(Ö ) | Ja minähän en keskellä kirkasta päivää lähden minnekään juoksentelemaan ilman housuja.

Scummbuddy

my projectiles would be like lazers, but yes using characters, i believe is what others use well.
- Oh great, I'm stuck in colonial times, tentacles are taking over the world, and now the toilets backing up.
- No, I mean it's really STUCK. Like adventure-game stuck.
-Hoagie from DOTT

deltamatrix

I have done something similar before. ;D

If you use using RawDrawLine for your lasers. To kill the character being zapped, you need to compare his Y position with the position of the laser itself with a 5% tolerance of error. You could create an everlasting sprite for a segment of lasers and RawDraw it across the screen until its projectile position matches that of a baddie then KABOOM.

Somehow I reckon you may be better off using a object of a missile or something coz i think that will look better. Then you can just use AreCharObjColliding() if that func still exists. Unfortunately that would limit the amount of bullets you can shoot at any one time with AGS's limited objects.

There is no pefect way of doin this in AGS coz its not designed for this sort of thing really.

What I wanna know is how are you controlling the bad guys. Are they characters, objects or a series of sequenced RawImages? Again, if you use objects or characters, I think you may limit how many can display on the screen at any one time. And you may have to copy and paste a little script for each individual duplicated objects. There are many ways of doin this. Take your pick.
BAD WOLF - TORCHWOOD - MR SAXON - THE BEES ARE DISAPPEARING - PANDORICA - RIVER SONG

SMF spam blocked by CleanTalk