Gamestudio Links
Zorro Links
Newest Posts
Zorro 2.70
by jcl. 09/29/25 09:24
optimize global parameters SOLVED
by dBc. 09/27/25 17:07
ZorroGPT
by TipmyPip. 09/27/25 10:05
assetHistory one candle shift
by jcl. 09/21/25 11:36
Plugins update
by Grant. 09/17/25 16:28
AUM Magazine
Latest Screens
Rocker`s Revenge
Stug 3 Stormartillery
Iljuschin 2
Galactic Strike X
Who's Online Now
1 registered members (Dico), 16,767 guests, and 5 spiders.
Key: Admin, Global Mod, Mod
Newest Members
krishna, DrissB, James168, Ed_Love, xtns
19168 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 | 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