We're archiving the forums and going read only! You'll be able to see old threads, but new topics and replies have been disabled.

Visit the Game Jolt community for new questions and conversations.


Game Maker Language is a built-in programming language for Game Maker. It is perfect for creating a 2D nice game. I am not a GML expert. But I can help you on GML coding. I also expect help from you.

You can post in this topic:

  1. Your game idea in Game Maker.

  2. Any kind of script that can be used in Game Maker.

  3. Reply others for resolve their problems in GML.

If you are a developer and you use Game Maker, you may create Game Maker Libray or Extensions, Game Maker Tutorials, Game Maker Projects or something else that can help Game Maker users. I hope you will be share it with others. A beginner GML user may be an expert.


Page 3 of 87 replies.

over 10 years ago

Kitten, can you please describe your problem clearly?

over 10 years ago

image_xscale = 2; make the image width 2x larger. e.g. 32 from 16.

image_xscale = 1/2; make the image width 2x shorter. e.g. 16 from 32.

Now you have to calculate. To make your image_width 32, use this

{ image_xscale = 32/sprite_width; }

Syntax:

{ image_xscale = new_size/old_size; }

Last modified on April 28, 2015 by RAF5UN @rafsun82

over 10 years ago

if (grounded)

{

		
			if (hsp ==0)

{

    sprite_index = spr_gryphon_idle;

}

else

if (sprite_index!=spr_gryphon_run) image_index = 0;

    sprite_index = spr_gryphon_run

    image_speed = 0.75;

    }
		
	

This is my Code for chnage to ANimations

But where i have to put the image_xscale to flip the sprite?

over 10 years ago

Maybe after "sprite_index = spr_gryphon_run".

over 10 years ago

If you trying to only rotate the image then image_xscale is not necessary.

This method is very easy.

  1. Make two image on a sprite. One is looking left and the other is looking right.

  2. On the object, on create event set "image_speed = 0".

  3. And you can change image by using "image_index = 0" or "image_index = 1".

Another method.

use variable "direction"

when looking left set "direction = 180".

when looking right set "direction = 0".

over 10 years ago

Obey but how i add this code to my code :

if (grounded)

{

		
			if (hsp ==0)

{

    sprite_index = spr_gryphon_idle;

}

else

if (sprite_index!=spr_gryphon_run) image_index = 0;

    sprite_index = spr_gryphon_run

    image_speed = 0.75;

    }
		
	
over 10 years ago

DELETED!!!

Last modified on April 28, 2015 by RAF5UN @rafsun82

over 10 years ago

if (grounded)

{

		
			if !key_right

{

    sprite_index = spr_gryphon_idle_right;

}

else

if (sprite_index!=spr_gryphon_run_right) image_index = 0;

    sprite_index = spr_gryphon_run_right

    image_speed = 0.75;

    }
		
	
over 10 years ago

I reliesed i cant make left animation

over 10 years ago

You can try this too -

{

		
			if keyboard_check(vk_left)

{

    sprite_index = spr_run;

    image_index = 0;

    hspeed = -3;

}

else if keyboard_check(vk_right)

{

    sprite_index = spr_run;

    image_index = 1;

    hspeed = 3;

}

else

{

    sprite_index = spr_idle;

    image_index = 0;

    hspeed = 0;

}
		
	

}

over 10 years ago

if (grounded)

{

		
			if !key_right

{

    sprite_index = spr_gryphon_idle_right;

}

else

if (sprite_index!=spr_gryphon_run_right) image_index = 0;

    sprite_index = spr_gryphon_run_right

    image_speed = 0.75;

    }

else

if !key_left

{

sprite_index = spr_gryphon_idle_left

}

if (sprite_index!=spr_gryphon_run_left) image_index = 0;

    sprite_index = spr_gryphon_run_left

    image_speed = 0.75;
		
	
over 10 years ago

Thas my solutuon

over 10 years ago

But i wont work xD

over 10 years ago

xD Do you try mine?

over 10 years ago

Check this now -

{

		
			if keyboard_check(vk_left)

{

    sprite_index = spr_run;

    image_index = 0;

    hspeed = -3;

}

else

{

    sprite_index = spr_idle_left;

    image_index = 0;

    hspeed = -3;

}

if keyboard_check(vk_right)

{

    sprite_index = spr_run;

    image_index = 1;

    hspeed = 3;

}

else

{

    sprite_index = spr_idle_right;

    image_index = 0;

    hspeed = 0;

}
		
	

}

over 10 years ago

try this now : ) -

{

		
			if keyboard_check(vk_left)

{

    sprite_index = spr_run;

    image_index = 0;

    hspeed = -3;

}

else

{

    sprite_index = spr_idle_left;

    image_index = 0;

    hspeed = -3;

}

if keyboard_check(vk_right)

{

    sprite_index = spr_run;

    image_index = 1;

    hspeed = 3;

}

else

{

    sprite_index = spr_idle_right;

    image_index = 0;

    hspeed = 0;

}
		
	

}

over 10 years ago

//Animate

if (place_meeting(x,y+1,obj_2))

{

		
			if (move!=0) 

{

    sprite_index = spr_gryphon_run_right; 

    image_speed = 1;

}

else 

sprite_index = spr_gryphon_idle_right; image_speed = 0.5;
		
	

}

But i want to flip the animation now

over 10 years ago

And i want that if i press left and release that my character looks to the left

over 10 years ago

try this:

keyleft = -keyboard_check(vk_left);
keyright = keyboard_check(vk_right);
movedirection = keyleft + keyright;

movedirection = positive 1 if right arrow is true
movedirection = negative 1 if left arrow is true
movedirection = 0 if right/left arrow if false or right/left arrow are both true

now you can check your movedirection variable for postitive/negative to change the sprite_index of your player sprite, or just flip the halign of your sprite with that variable.

over 10 years ago

This tutorial is about getting input. I didn't describe it. You can ask me question.

Features -

  1. Multiple text box.

  2. Text box focus change effect.

  3. Paste data from clipboard.

  4. Prevent enter.

Preview -

5d09922f1529f.png

Download -

Click to download

over 10 years ago

It's cool Buddy :D
Keep it up :D

over 10 years ago

Thank you Papa.

over 10 years ago

Hi there;

Is it possible for me to create an online save file service for my game? In more detail: I want my players to be able to save their games to an online location, so that they don't get accidentally deleted from their system, and also to let them access the file from any computer. Does anyone know how to do this with GM Studio? Thanks in advance! :)

over 10 years ago

You could always use the GJ API data storage features. You should check it out. GM: Studio has a library supported for this.

over 10 years ago

Yes you can use online data store system by using Game Jolt Api. I also did :). But I don't know about accessing files from any computer.

Check this link for the api for GM:S,

http://gamejolt.com/community/forums/topics/gm-studio-adding-achievements-complete-beginners-guide/2935/

You can only store plain text, not a file.

over 10 years ago

The HTTP Event (Game Maker Studio):

If you don't understand how this event works you can't use Game Jolt api for this engine properly. Only one way of getting data from the server is HTTP event. It will better if you make this example by using codes below then read start reading this topic.

First of all you have to call a http web request. And have to put the request id on a variable. And you will get result in the HTTP event.

Suppose, when I will press Enter it will call a web request and put the id on a variable.

http_web_req = gj_datastore_get_global("version");

This above code will request for data from global data storage of your game. "version" is the key name.

After making this request you will get result on HTTP event after few times depends on your internet speed.

First, you have to check if the request called. It will call after pressing Enter. Check this by gj_result_id function. Then, have to check if internet connection is okay or requested key exists by function gj_result_status.

If you passed this two statements then you are ready for getting data. The fuction gj_result_data_field will give you data. This function needs a parameter. That is "data". But this parameter is different for different result. Read the document for learn more about parameters.

Now, clear results using gj_result_clear. If you run the game it will show you a messy error message. Just avoid it and listen to me...

HTTP event is like Step event. It check for request in every step (but execute codes once per call). It will check the variable http_web_req because you set the code for checking request. But this variable didn't declare. And this is the error.

Declare it with a value in create event. Recommended value is -1. And it will work now.

Example:

// Create Event:

{

http_web_req = -1;

}

// Game Start:

{

gj_init("xxxx","xxxx");

}

// Pressed Enter Event:

{

http_web_req = gj_datastore_get_global("version");

}

// HTTP Event:

{

if gj_result_id() == http_web_req

{

if gj_result_status() == 1

{

data = gj_result_data_field("data");

}

else

{

data = gj_result_error();

}

show_message(data);

gj_result_clear();

}

}

This post is editable. My English is weird. Sorry for that.

almost 4 years ago

HELP I'M USING THE GAMEJOLT API AND THIS APPEARS TO ME

___________________________________________

################################################## ##########################################

FATAL ERROR in

action number 1

of Async Event: HTTP

for object obj_controller:

string_copy argument 1 incorrect type (undefined) expecting a String (YYGS)

at gml_Script_gj_result_status (line 19) - case "SUCCESS":

################################################## ##########################################

-------------------------------------------------- ------------------------------------------

stack frame is

gml_Script_gj_result_status (line 19)

called from - gml_Object_obj_controller_WebAsyncEvent_1 (line 47) - var status = gj_result_status ();