Gamestudio Links
Zorro Links
Newest Posts
Free Live Data for Zorro with Paper Trading?
by AbrahamR. 05/18/24 13:28
Change chart colours
by 7th_zorro. 05/11/24 09:25
Data from CSV not parsed correctly
by dr_panther. 05/06/24 18:50
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
4 registered members (degenerate_762, AbrahamR, AndrewAMD, ozgur), 667 guests, and 8 spiders.
Key: Admin, Global Mod, Mod
Newest Members
Hanky27, firatv, wandaluciaia, Mega_Rod, EternallyCurious
19051 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 | 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