Jump to content


lord thoorin

Member Since 01 Jan 2011
Offline Last Active May 01 2012 11:24 AM

Posts I've Made

In Topic: Problem with enemy, again :-)

19 April 2012 - 10:55 AM


Ok thanks, when i will have a time i will try to translate the code to english.


Just add some guidelines so we non-Czech (assuming you are Czech) can follow along. (Googled the words)
doleva = left
doprava = transport
nahoru  = up


Yeah I am czech :-).
yes doleva and nahoru is like you said. Doprava as you say is transport too, but here it means Right :-)

direction = "down"
difference_y = 0
difference_x = 0

if obj_player.x > x{     
if obj_player.y > y {direction = "right_down"
}
}

if obj_player.x > x  {    
if obj_player.y < y{direction = "right_up" }
}

if obj_player.x < x {    if obj_player.y > y{direction = "left_down"}
}

if obj_player.x < x {    if obj_hrac.y < y {direction = "left_up"}
}
if obj_player.x > x {    if difference_y < 4 { if difference_y > -4{direction = "right"}
}
}

if obj_player.x < x {     if difference_y < 4 { if difference_y > -4 {direction = "left"}
}
}

if difference_x < 4 { if difference_x > -4{     if obj_player.y < y{direction = "up"}
}
}

if difference_x < 4 { if difference_x > -4{     if obj_player.y > y{direction = "down"}
}
}

switch (direction){         
case "right": sprite_index=spr_enemy_right; x+=2; break;         
case "left" : sprite_index=spr_enemy_left;  x-=2; break;        
 case "up" : sprite_index=spr_enemy_up;  y-=2; break;         
case "down"   : sprite_index=spr_enemy_down;    y+=2; break;         
case "right_up" : sprite_index=spr_enemy_right_up; y-=2 x+=2; break;         
case "right_down"   : sprite_index=spr_enemy_right_down;   y+=2 x+=2; break;         
case "left_down"    : sprite_index=spr_enemy_left_down;    y+=2 x-=2; break;         
case "left_up"  : sprite_index=spr_enemy_left_up;  y-=2 x-=2; break;         
}         

difference_y = obj_player.y - obj_enemy.y
difference_x = obj_player.x - obj_enemy.x

In Topic: Problem with enemy, again :-)

17 April 2012 - 12:45 PM

Ok thanks, when i will have a time i will try to translate the code to english.

In Topic: Problem with enemy, again :-)

16 April 2012 - 07:11 PM

Like change your first case to case 1 the second to case 2 and so on. And maybe you'd be interested in a competition. Sorry about the short notice, but it ends tonight at 6pm CST or 6 hours and 20min from now. This is the website. The theme is TD and you come up with what it stands for.


Its strange what you say, i have never written numbers like this after case and its worked. But ok i tried that, but it didn't worked. I think the problem is somewhere else, but thank you for helping me.

In Topic: Problem with enemy, again :-)

14 April 2012 - 03:05 PM

is it because you didn't set your cases? Like case 1, case 2, ect.


I dont understand what do you mean. :-)

In Topic: Road Warriors II

01 March 2012 - 03:45 PM

Nice game! Funy, good graphic.