Gamestudio Links
Zorro Links
Newest Posts
Executing Trades on Next Bar Open
by vicknick. 06/13/24 08:51
Zorro Beta 2.61: PyTorch
by jcl. 06/10/24 14:42
New FXCM FIX Plugin
by flink. 06/04/24 07:30
AlpacaZorroPlugin v1.3.0 Released
by kzhao. 05/22/24 13:41
Free Live Data for Zorro with Paper Trading?
by AbrahamR. 05/18/24 13:28
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
0 registered members (), 1,280 guests, and 4 spiders.
Key: Admin, Global Mod, Mod
Newest Members
AemStones, LucasJoshua, Baklazhan, Hanky27, firatv
19059 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