The Daily Click ::. Forums ::. Klik Coding Help ::. How to do this kind of A.I.?
 

Post Reply  Post Oekaki 
 

Posted By Message

AvatarTR



Registered
  04/08/2007
Points
  45
14th August, 2007 at 10:31:30 -

Hello everyone,

I'm pretty much done with the hero side of my game but now I need help with the enemy side of the game. The thing on my mind was this:

Imagehttp://img263.imageshack.us/img263/9412/onemanarmyjd3.gif</IMG>
Image


The most important thing here is how to make it so that the planes come forth from the direction mentioned above and drop airbones down to the ground. The airbones how successfully dropped to the ground should go to the war factory door. Get a box (active object - small box) and run out of from the right or left.

So is this possible, if so how?

Image Edited by the Author.

 
avatarturkiye.com

-Liam-

Cake Addict

Registered
  06/12/2008
Points
  556

Wii OwnerIt's-a me, Mario!Hero of TimeStrawberry
14th August, 2007 at 10:41:46 -

When plane reaches certain pos in frame shoot "guy"

When "guy" hits backdrop create object "guy2" relative to "guy" (Guy2 will walk towards the factory)

And so on and so on...


How come you have like, 3 accounts?

Edit: There is a better way of doing it but I'd have to think (Not difficult though)

Image Edited by the Author.

 
Image

Tell 'em Babs is 'ere...

AvatarTR



Registered
  04/08/2007
Points
  45
14th August, 2007 at 11:49:35 -

I'll try out what you mentioned.

And this is my only account
The name in the bracket is the group I'm in actually.

 
avatarturkiye.com

Sketchy

Cornwall UK

Registered
  06/11/2004
Points
  1970

VIP MemberWeekly Picture Me This Round 43 Winner!Weekly Picture Me This Round 47 WinnerPicture Me This Round 49 Winner!
14th August, 2007 at 12:19:54 -

Obviously I haven't actually tried any of this out, but anyways....


Ok, to start with, you're going to want to create a new plane every so often, just off the left or right edge of the screen:

every 5 secs (or whenever)
* create plane
* set plane X to (rand(2)*760)-60 (that places them either at -60 or 700, which would be about right if screen is 640 wide)
* set plane y to rand(200) (makes the planes fly at different altitudes)

if plane: flag0 is off
* plane: look in direction of the middle of the screen (make sure the planes only have 4 directions of movement though)
* plane: set flag0 on


Now, judging by the diagram, you want most of the paratroopers to be dropped around the middle of the screen:

if random(640) < plane(X) (this way, the further the plane flies, the greater the chance of it dropping a para.)
+ plane: flag1 is off (stops one plane dropping many paras - maybe disable every second)
+ plane direction is -->
* create paratrooper at plane
* set paratrooper alterable value A to rand(50)+300 (this will be the altitude at which their parachute opens)
* set paratrooper direction to down (use 32 directions)
* plane: set flag1 on

if random(640) > plane(X)
+ plane: flag1 is off
+ plane direction is <--
* create paratrooper at plane
* set paratrooper alterbale value A to rand(50)+300
* set paratrooper direction to down
* plane: set flag1 on


Initially, I'd have the paratroopers falling fast (maybe accelerating), until they reach a certain altitude, and then have their

parachutes open and them fall slowly:

paratrooper Y >= paratooper: alterable value A
* change animation to open parachute
* set speed to ? (slow)

While the paras are in the air with their parachutes open, I'd set their direction to a random one of the downward directions (23,

24, 25) every now and then. This way they'll kind of float down instead of just falling vertically.

every ? (very often)
+ paratrooper animation is open parachute
+ pick paratrooper at random (so they aren't all synchronized which would look weird)
* set direction to random out of 23, 24, and 25


Once the paratroopers reach the ground you can just tell them to head for the factory:

paratrooper collides with ground
* create landed para at paratrooper (it's just easier to use a different active for the landed paras)
* landed para: look in direction at factory
* destroy paratrooper

landed para collides with factory
* change landed para animation to carrying box
* set landed para speed to ? (make them slower when carrying the box)
* set direction to random out of <-- and -->



 
n/a

AvatarTR



Registered
  04/08/2007
Points
  45
14th August, 2007 at 12:28:06 -

There was an full example game made with Game Maker 7, which I'm trying to make a similar clone of but I forgot the link. But I'll try out what you mentioned

 
avatarturkiye.com
   

Post Reply



 



Advertisement

Worth A Click