The Daily Click ::. Forums ::. Klik Coding Help ::. Enemy moves thru walls even though I do in fact have the line of code which tells him/her to stop
 

Post Reply  Post Oekaki 
 

Posted By Message

Sage



Registered
  02/01/2004
Points
  43
29th April, 2004 at 12:02:43 -

Okay here's the deal.
I got the Player and the Enemy and some walls. When the Player gets within a certain distance from the enemy, the Enemy "activates" and starts moving towards the Player with the "Start Movment" event.

BUT, the Enemy moves through the walls.

Yeas I do in fact have the line of code that says
"When the Enemy hits da wall, Stop"

But it won't, since it is always Starting the movement since the Player and the Enemy are within pooping distance.

Thanks you...

 
-Sage

Herb



Registered
  24/02/2004
Points
  264
29th April, 2004 at 12:11:24 -

Dunno what you want to do, but as long as the line of code tells the enemy to go towards the player, it will do just that.


Image Edited by the Author.

 
Quality.

X_Sheep

I had a custom rating before it was cool

Registered
  01/03/2004
Points
  1313

VIP MemberPicture Me This -Round 23- Winner!Dos Rules!
29th April, 2004 at 12:15:34 -

I think you should add the line "Restrict actions for 00.05 seconds" to give the program time to detect whether it's hitting a wall or not before facing towards the player again.

 
a/n

Klikmaster

Master of all things Klik

Registered
  08/07/2002
Points
  2599

Has Donated, Thank You!You've Been Circy'd!VIP MemberPS3 Owner
29th April, 2004 at 12:37:02 -

You could turn a flag on or change a value when he hits the wall, thus keeping him there, and change it back when the player has moved away

 
n/a

Echisketch(PS)



Registered
  20/03/2004
Points
  852
29th April, 2004 at 18:32:51 -

maybe u fergot to make it da obstacle for the walls, yuh?

 
"Everytime you use Kazaa, a metallica band member dies a little."
Quote Jonathon Smeby.

Assault Andy

Administrator
I make other people create vaporware

Registered
  29/07/2002
Points
  5686

Game of the Week WinnerVIP Member360 OwnerGOTM JUNE - 2009 - WINNER!GOTM FEB - 2010 - WINNER!	I donated an open source project
1st May, 2004 at 08:04:54 -

Echisketch - It's not that, I think the problem is when the enemy is told to stop on a wall, he just starts again.

Wouldn't this work?

Player is in a certain distance from enemy
+ Enemy is NOT overlapping a wall - Movement Start.

 
Creator of Faerie Solitaire:
http://www.create-games.com/download.asp?id=7792
Also creator of ZDay20 and Dungeon Dash.
http://www.Jigxor.com
http://twitter.com/JigxorAndy

Mr Icekirby



Registered
  18/12/2003
Points
  846
1st May, 2004 at 10:08:52 -

ok, maybe im not leaving,

what you want is a box that the enemy fits inside, but have no space, then always have its position set to the enemy puls or minus some pixels to line it up
the box must be like 5 pixels or so thick outward, and at start of level, make it invisible unless you like the box

Player is in certain distance from enemy
[negate] box is overlapping a backdrop
>>start movement

 
Mr Icekirby says so!
OBEY ME!

AndyUK

Mascot Maniac

Registered
  01/08/2002
Points
  14586

Game of the Week WinnerSecond GOTW AwardHas Donated, Thank You!VIP Member
1st May, 2004 at 11:28:30 -

You need an event that pushes the enemy in the opposite direction at the same speed so that the enemy wont move.

when the enemy is facing going left push then right
and vice versa.

to push them in the opposite direction you could make them move relative to their own x coordinate +1 or +2 whatever is needed.

that should work for a platform game,
but wont for a top down game.

you didnt say what you were making.

 
.

Willy C



Registered
  14/02/2004
Points
  1524

Game of the Week WinnerKlikCast StarPicture Me This -Round8- Winner!VIP MemberWii OwnerIt's-a me, Mario!Hero of TimeThe Cake is a LiePS3 OwnerI am an April Fool
Batman!Teddy Bear
2nd May, 2004 at 04:40:38 -

If you game is 8 directional make it like this:

Player is in a certain distance from enemy
+ Enemy is NOT overlapping a wall - Movement Start

Player is in a certain distance from enemy
+ Enemy IS overlapping a wall - Movement Bounce


If the game is a platformer make 2 triggers following the player "trigger left" and "Trigger right"

Left trigger is overlapping wall - move the character to the right
Right trigger is overlapping wall - move the character to the left

 
http://www.robocaptain.com
   

Post Reply



 



Advertisement

Worth A Click