Gamestudio Links
Zorro Links
Newest Posts
optimize global parameters SOLVED
by dBc. 09/27/25 17:07
ZorroGPT
by TipmyPip. 09/27/25 10:05
Release 2.68 replacement of the .par format
by Martin_HH. 09/23/25 20:48
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
0 registered members (), 18,175 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
Problem creating a looping with c_move #334101
07/21/10 09:08
07/21/10 09:08
Joined: Jul 2010
Posts: 127
Germany, Herford
Ditje Offline OP
Member
Ditje  Offline OP
Member

Joined: Jul 2010
Posts: 127
Germany, Herford
Hi,
i am working on an enemy moving script. The enemy comes from a start position and flies to next position. There, it should "roll" a loop around the x axis (step 2) but it doesn`t. After reaching -270° entity flies straight ahead.

The only solution, I found is rotationg the last missing 90° on a fixed position (temporary step 3). That`s not nice laugh

Where is my mistake?

This is how it should be:




Thanks

Ditje

Code:
function start_bee() 
{
	while(1)
	{
		me.tilt = 70;
		me.pan = -45;
		my.STATE = 1;
		if(my.STATE == 1)
		{
			if(me.y <=200) c_move(me, vector(0, 0, 10 * time_step), vector(0, 0, 0), GLIDE); // bis 200 gerade aus
			else my.STATE = 2;
			
		}
		if(my.STATE == 2)
		{
			if(me.roll >= -270) 
			{ 
				me.roll -=1;
				c_move(me, vector(0, 0, 10 * time_step), vector(0, 0, 0), GLIDE); // einen Loop fliegen
			}
			else 
			{
				my.STATE = 3;
			}
		}
		if(my.STATE == 3)
		{
			if(me.roll >= -360) 
			{ 
				me.roll -=1;
				//c_move(me, vector(0, 0, 10 * time_step), vector(0, 0, 0), GLIDE); // einen Loop fliegen
			}
			else 
			{
				my.STATE = 4;
			}
		}
		if(my.STATE == 4)
		{
			if(me.y <= 400) 
			{ 
				c_move(me, vector(0, 0, 10 * time_step), vector(0, 0, 0), GLIDE); // einen Loop fliegen
			}
			else 
			{
				my.STATE = 5;
			}
		}
		if(my.STATE == 5)
		{
			// go to final psoition
		}
		testroll = me.roll;
		
		wait(1);
	}
	
}



Re: Problem creating a looping with c_move [Re: Ditje] #334113
07/21/10 10:48
07/21/10 10:48
Joined: Jul 2010
Posts: 127
Germany, Herford
Ditje Offline OP
Member
Ditje  Offline OP
Member

Joined: Jul 2010
Posts: 127
Germany, Herford
Now the loop looks quite good, but I am not really satisfied with the 2-step solution. You can still see, when it switches until 270°.

But I have a new question belonging to this topic. It`s the 4th step. I don`t have any idea, how to move an entity from variable to fixed positions.

Ditje


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