enemys walking off the edge...
				
Posted: 
Wed Jul 21, 2010 5:39 amby pizbi
				how do I make an enemy turn around before it falls of a edge?  

 
			
				Re: enemys walking off the edge...
				
Posted: 
Wed Jul 21, 2010 6:19 amby Hblade
				I was also wondering the same thing 

 
			
				Re: enemys walking off the edge...
				
Posted: 
Wed Jul 21, 2010 7:34 amby savvy
				you could try putting little canvas' on the edges so that when the enemy touches them it turns around.
			 
			
				Re: enemys walking off the edge...
				
Posted: 
Wed Jul 21, 2010 10:06 amby Hblade
				oh good idea 

 Or a filled region to prevent lag :3
 
			
				Re: enemys walking off the edge...
				
Posted: 
Wed Jul 21, 2010 11:53 amby Game A Gogo
				- Code: Select all
- if(CollisionFree("Event Actor",x,y+2)==0)
 {
 //Turn around script here, Here's what it could be?
 ChangeAnimation(///);
 xvelocitty=-xvelocity;
 }
Hope this helps 

This might not work all the time; if there are actor that do not have the Collision State set to Disable (It's a function) and goes under the character, well it'll turn around as well
 
			
				Re: enemys walking off the edge...
				
Posted: 
Wed Jul 21, 2010 3:14 pmby Game A Gogo
				if you want the enemy to change sides also when he encounters an objects on the left/right (So he doesn't hit them)
simply change the line 
- Code: Select all
- if(CollisionFree("Event Actor",x,y+2)==0)
 to 
- Code: Select all
- if(CollisionFree("Event Actor",x,y+2)==0||CollisionFree("Event Actor",x-2,y)==0||CollisionFree("Event Actor",x+2,y)==0)
Just trowing this in 

 
			
				Re: enemys walking off the edge...
				
Posted: 
Wed Jul 21, 2010 3:35 pmby jimmynewguy
				Sgt. Sparky was a genius. 
viewtopic.php?f=6&t=3600 
			
				Re: enemys walking off the edge...
				
Posted: 
Wed Jul 21, 2010 5:43 pmby Hblade
				He was.. one of the smartest kids I known
			 
			
				Re: enemys walking off the edge...
				
Posted: 
Thu Jul 22, 2010 1:35 amby krenisis
				Wow jimmy 2006? how long you been here? jimmytheoldguy lol!!
			 
			
				Re: enemys walking off the edge...
				
Posted: 
Thu Jul 22, 2010 3:19 amby jimmynewguy
				i used GE for about 6 months before i joined the forum so almost 4 years actually 

 
			
				Re: enemys walking off the edge...
				
Posted: 
Thu Jul 22, 2010 9:25 amby DST
				Filled regions aren't a good idea for doing this because you will have to place them on every single platform that is to have an enemy on it.
Then, editing your game becomes much much slower. You'll find you have to change platform positions for all sorts of reasons to make your levels challenging yet playable.
One thing you can do is with a cloned platform, is collision>topside>platform>repeat no>
int twidth=(collide.width/2)-(width/2);
xlimit1=collide.x-twidth;
xlimit2=collide.x+twidth;
Then in enemy>draw actor>, just have the enemy walk between the two points.