2019-09-26 00:34:53 (edited by Kitsune 2019-09-26 00:39:26)

so. I have some bgt code. but, wen the g key is pressed, nothing works.
void game()
{
while(true);
{
if (key_pressed(KEY_G))
{
house();
}
if (key_pressed(KEY_Q)
{
EXIT();
}
}

I am a divine being. I can be called a primordial deity, but that might be pushing it, a smidge. I am the only one of my kind to have ten tails, with others having nine. I don't mean to sound arrogant, but I have ascended my own race.

2019-09-26 02:37:44

First of all, you're showing one function called game, not main. Now, game can be a function but main has to be there too, and main needs to have the game window set up or it can't take keyboard focus. Second, when you're working with multiple conditionals like that, you need to use else if, not just two ifs side by side like that. Finally, you're missing a closing parenthesis on the second if statement.

Facts with Tom MacDonald, Adam Calhoun, and Dax
End racism
End division
Become united

2019-09-26 03:16:24

First, we don't know what the main function looks like, so that could be part of the issue. Second, you're missing the second right paren on the second if statement, and third, on the second if, you'd want else if, not just if.

2019-09-26 09:06:32

In the while loop, there should not be a ; or semi colon after the last )

best regards
never give up on what ever you are doing.

2019-09-26 13:25:52

it works now, thanks! @4.

I am a divine being. I can be called a primordial deity, but that might be pushing it, a smidge. I am the only one of my kind to have ten tails, with others having nine. I don't mean to sound arrogant, but I have ascended my own race.