Gamestudio Links
Zorro Links
Newest Posts
Help with plotting multiple ZigZag
by degenerate_762. 04/30/24 23:23
M1 Oversampling
by 11honza11. 04/30/24 08:16
Trading Journey
by howardR. 04/28/24 09:55
Zorro Trader GPT
by TipmyPip. 04/27/24 13:50
Data from CSV not parsed correctly
by jcl. 04/26/24 11:18
Why Zorro supports up to 72 cores?
by jcl. 04/26/24 11:09
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
3 registered members (Quad, VoroneTZ, 1 invisible), 852 guests, and 3 spiders.
Key: Admin, Global Mod, Mod
Newest Members
wandaluciaia, Mega_Rod, EternallyCurious, howardR, 11honza11
19049 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
inkey for integers/floats? #238045
11/24/08 14:35
11/24/08 14:35
Joined: Jul 2007
Posts: 48
M
MattyTheG Offline OP
Newbie
MattyTheG  Offline OP
Newbie
M

Joined: Jul 2007
Posts: 48
Hey guys, I'm working on a game where I want the user to be able to enter a launch angle, which will then be set to the objects tilt. Is there any type of function that is like inkey() but for numbers instead of strings? I tried using inkey and just entering numbers into the string but it didn't seem to do anything. I'm using lite-C by the way. I know how to do it in C++ but not everything else so I chose lite-c hah.

Thanks in advance for the help.

Re: inkey for integers/floats? [Re: MattyTheG] #238050
11/24/08 15:43
11/24/08 15:43
Joined: Oct 2008
Posts: 218
Nashua NH
heinekenbottle Offline
Member
heinekenbottle  Offline
Member

Joined: Oct 2008
Posts: 218
Nashua NH
Try str_to_num, str_to_float and str_to_int

These three functions turn a string into a var, float and int respectively.

So you'd use inkey to get the string from the player, and then use one of the above instructions

Last edited by heinekenbottle; 11/24/08 15:44.

I was once Anonymous_Alcoholic.

Code Breakpoint;

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