Gamestudio Links
Zorro Links
Newest Posts
loading historical data 1st time
by AndrewAMD. 04/14/23 12:54
Trade at bar open
by juanex. 04/13/23 19:43
Bug in Highpass2 filter
by rki. 04/13/23 09:54
Adding Limit Orders For IB
by scatters. 04/11/23 16:16
FisherN
by rki. 04/11/23 08:38
AUM Magazine
Latest Screens
SHADOW (2014)
DEAD TASTE
Tactics of World War I
Hecknex World
Who's Online Now
3 registered members (AndrewAMD, juanex, Grant), 1,018 guests, and 8 spiders.
Key: Admin, Global Mod, Mod
Newest Members
rki, FranzIII, indonesiae, The_Judge, storrealba
18919 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Kill the enemy #386171
10/29/11 19:59
10/29/11 19:59
Joined: Oct 2011
Posts: 21
O
oODarkPassionOo Offline OP
Newbie
oODarkPassionOo  Offline OP
Newbie
O

Joined: Oct 2011
Posts: 21
Hello,

i'va a question about my simple kill the enemy system wink

Code:
function attack()
{
	VECTOR enemy_speed;
	VECTOR temp;
	my.skill99 = 1;
	my.health = 20;
	
	if(event_type == EVENT_IMPACT)
 	{
 		my.health -= 50;
 		if(my.health <= 0)
 		my.event = explode;
 	}
	
	while(my.health > 1 || player == 1)
	{
			vec_set (temp.x, player.x);
         vec_sub (temp.x, my.x);
         vec_to_angle (my.skill99, temp);
         my.pan -= ang(my.pan - my.skill99) * 0.2 * time_step;
         
         wait(1);
         
         c_move (me, vector(0.1 *time_step, 0, 0), nullvector, GLIDE);
			wait (1);

   		// Setze Licht unterhalb der Entität (dynamisch)
   		my.lightrange = 30;
   		my.red = 0;
   		my.green = 0;
   		my.blue = 255;
   		set(my,LIGHT);
}



How you can see the enemy have 20LP one shot that hits the enemy subtract 50LP.
Why only die the enemy after the second shot and not already with the first shot?

Thanks for your time

oODarkPassionOo

Re: Kill the enemy [Re: oODarkPassionOo] #386176
10/29/11 21:05
10/29/11 21:05
Joined: Oct 2011
Posts: 21
O
oODarkPassionOo Offline OP
Newbie
oODarkPassionOo  Offline OP
Newbie
O

Joined: Oct 2011
Posts: 21
Hello again laugh

problem fixed itself wink
I have no idea why but now it works fine.


Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1