Install Steam
login
|
language
简体中文 (Simplified Chinese)
繁體中文 (Traditional Chinese)
日本語 (Japanese)
한국어 (Korean)
ไทย (Thai)
Български (Bulgarian)
Čeština (Czech)
Dansk (Danish)
Deutsch (German)
Español - España (Spanish - Spain)
Español - Latinoamérica (Spanish - Latin America)
Ελληνικά (Greek)
Français (French)
Italiano (Italian)
Bahasa Indonesia (Indonesian)
Magyar (Hungarian)
Nederlands (Dutch)
Norsk (Norwegian)
Polski (Polish)
Português (Portuguese - Portugal)
Português - Brasil (Portuguese - Brazil)
Română (Romanian)
Русский (Russian)
Suomi (Finnish)
Svenska (Swedish)
Türkçe (Turkish)
Tiếng Việt (Vietnamese)
Українська (Ukrainian)
Report a translation problem
while (i < 10)
{
i -= 1;
}
would run forever and force the game to hang.
Main way to tell if its something like that is do you have to hit the stop web server button to be able to launch the game again? Its next to the run the game and run the game with debug buttons.
sorry for being stupid but its my first game and i have been working on it for hours
Look for any loops and comment them out with /* at the start and using */ after the loop. Keep testing with all loops one at a time till the game starts working. If it works then that loop is some how running forever and you need to fix that. How to fix that is based on the loop that is causing it.
{
x += sign(hsp);
}
hsp = 0;
while(!place_meeting(x,y+sign(vsp),obj_solid))
{
y += sign(vsp);
}
vsp = 0;
is there anything wrong with em?
idk
Look i honestly just watched a tutorial for codes and used them for a platformer.
everything went fine and I undertsood EVERYTHING but I just cannot run the game
//Get the player's input
key_right = keyboard_check(vk_right);
key_left = -keyboard_check(vk_left);
key_jump = keyboard_check_pressed(vk_space);
//React to inputs
move = key_left + key_right;
hsp = move * movespeed;
if (vsp < 10) vsp += grav;
if (place_meeting(x,y+1,obj_solid))
{
vsp = key_jump * -jumpspeed
}
//Horizontal Collision
if (place_meeting(x+hsp,y,obj_solid))
{
while(!place_meeting(x+sign(hsp),y,obj_solid))
{
x += sign(hsp);
}
hsp = 0;
}
x += hsp;
//Vertical Collision
if (place_meeting(y+vsp,y,obj_solid))
{
while(!place_meeting(x,y+sign(vsp),obj_solid))
{
y += sign(vsp);
}
vsp = 0;
}
y += vsp;
if (place_meeting("y+vsp",y,obj_solid))
youre checking on the x axis with the y cordinate.
change it to
if (place_meeting(x,y+vsp,obj_solid))
that should work