Gamestudio Links
Zorro Links
Newest Posts
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
Help with plotting multiple ZigZag
by degenerate_762. 04/30/24 23:23
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
2 registered members (dr_panther, 7th_zorro), 1,203 guests, and 2 spiders.
Key: Admin, Global Mod, Mod
Newest Members
firatv, wandaluciaia, Mega_Rod, EternallyCurious, howardR
19050 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 2 of 2 1 2
Re: confused about c script, lite c, wdl [Re: Scorpion] #157898
10/02/07 10:26
10/02/07 10:26
Joined: May 2006
Posts: 398
Bot190 Offline
Senior Member
Bot190  Offline
Senior Member

Joined: May 2006
Posts: 398
you could just do it like this, i think.

Code:
Function RotateMe()
{
my.pan += 2 * time_step;
}

on_a = Rotate_Me();




Wait, there isn't a "Make My Game Now" button?
Re: confused about c script, lite c, wdl [Re: Bot190] #157899
10/02/07 10:43
10/02/07 10:43
Joined: Jul 2006
Posts: 503
Australia
A
adoado Offline

User
adoado  Offline

User
A

Joined: Jul 2006
Posts: 503
Australia
Exactly. An endless loop works well, don't get me wrong

There is an alternate method - the one Bot190 explained.

Programming is logical, once you know a bit about the structure and learn to think about a situation in a "programming" way - everything is easier and, everything will make sense


Visit our development blog: http://yellloh.com
Re: confused about c script, lite c, wdl [Re: adoado] #157900
10/02/07 11:28
10/02/07 11:28
Joined: Sep 2007
Posts: 658
germany
Tiles Offline OP
User
Tiles  Offline OP
User

Joined: Sep 2007
Posts: 658
germany
Quote:

Programming is logical, once you know a bit about the structure and learn to think about a situation in a "programming" way - everything is easier and, everything will make sense




I made several 2D Games in the past, using an authoring tool. Still waiting for that bit

Let's have a logical look at it. The Function does noting until it is called, correct? Nothing endless because nothing performed. I have to press "a" to call the function. And then the Function is performed. When called i need it to be endless though. Because i want to rotate the object as long as i press the "a" key.

With your way the function is always called. Just that the "a" button isn't pressed. And so it doesn't rotate. Yes, it's just this little "While" line that i logically save compared to my method. At least from what i understand. But i search the best way here. Maye a bit too ambitious for now

For the alternative way, well i tried that before. Was one of the first things. As told, i tried everything that could somehow work ...





What i wonder a bit is that there seems to be no standard solution. This is a standard problem in my opinion. I simply want to control an object by keyboard keys to fly around with an airplane for example.


trueSpace 7.6, A7 commercial
Free gamegraphics, freewaregames http://www.reinerstilesets.de
Die Community rund um Spiele-Toolkits http://www.clickzone.de
Re: confused about c script, lite c, wdl [Re: Tiles] #157901
10/02/07 12:08
10/02/07 12:08
Joined: Jul 2006
Posts: 503
Australia
A
adoado Offline

User
adoado  Offline

User
A

Joined: Jul 2006
Posts: 503
Australia
Code:


action rotate_plane()
{
while (1)
{
my.pan = my.pan + 2 * time_step;
wait (1);
}
}



Stick with the loop method - its works and theres really nothing wrong with doing it that way

The code in your picture will not work properly I don't think. Assigning functions to specific keys must be performed outside a function or action (at least with C-script), and "my" is an undefined pointer.

Yes, thats right, functions only run when they get called (the function "main" and starter functions run automatically)


Adoado.


Visit our development blog: http://yellloh.com
Re: confused about c script, lite c, wdl [Re: adoado] #157902
10/02/07 12:29
10/02/07 12:29
Joined: Sep 2007
Posts: 658
germany
Tiles Offline OP
User
Tiles  Offline OP
User

Joined: Sep 2007
Posts: 658
germany
Okay. Thank you


trueSpace 7.6, A7 commercial
Free gamegraphics, freewaregames http://www.reinerstilesets.de
Die Community rund um Spiele-Toolkits http://www.clickzone.de
Page 2 of 2 1 2

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