Page 1 of 1

help with stupid enemy actor

PostPosted: Tue Feb 20, 2007 12:47 am
by jonas
First of all I have to thank makslane for making this great program and all you friendly people on this forum for being a great help and inpiration!
I have fiddled around with GE and desided to make a complete game. I chose Outlaw by Atari, because it was the first game I got for my Vic20 back in the early 80s... :lol:
Image

I thought it should be a piece of cake to make, even for a newbie like me, but I'm having a problem with the computer controlled enemy:
His movements (up and down only) is controlled with the MoveTo command relative to his enemy and his shooting is controlled by a random timer. This makes him look more like a zombie instead of a quick gunfighter, and he isn't much of a match,really.
So, if anyone here could give some hints on how I can give him som sort of brains, I would be most greatful! :)

PostPosted: Tue Feb 20, 2007 12:50 pm
by makslane
Try to increase the MoveTo velocity.

PostPosted: Tue Feb 20, 2007 6:48 pm
by jonas
The speed is not the issue, I am thinking about the enemy's ability to try to dodge bullets instead of just standing there and only shooting when the player is nearby- in other words-making him "more human" :)

PostPosted: Wed Feb 21, 2007 1:23 am
by makslane
May be the MoveTo action is not the right choice.
You can try make moves based on the y position of the player.
In the Draw Actor event of the enemy, put this:

Code: Select all
double weight = 10;

if(ActorCount("shot") > 0)
{
  //The player shot. Get it out here!
  y++;
}
else
{
  //No shots, so, go to the player
  y = ((weight  - 1)*y + player.y)/weight;
}

PostPosted: Wed Feb 21, 2007 2:01 am
by jonas
Yes,this did the trick! :D Thanks a million, makslane. I will sleep good tonight...