Hello, thanks for visiting GameML, if you are a Game Maker user, this is the site for you, please sign up, or login if you are already a member, or just browse the site! Welcome to GameML!

ATTENTION MEMBERS!!! USERS CAN NOW SIGN UP AGAIN!
Log in

I forgot my password

Search
 
 

Display results as :
 


Rechercher Advanced Search

Site Hits
Free hit counter
These stats started at 0 on July 7th 2009
GameML File Sharing
USERNAME: gamemladmin@gmail.com PASSWORD: gamemlsite Upload Here: http://gameml.iowoi.org/GameML-File-Sharing-h3.htmPlease add only games.
Create A GAMEML BLOG!
Make a Blog on GameML:http://gamemlblogs.wetpaint.com
Keywords


Simple Codes by 3d

View previous topic View next topic Go down

Simple Codes by 3d

Post by 3d on Sun May 31, 2009 4:34 pm

Here are codes that people need alot, that i made and codes I've found. If you have a code you want to submit, post it in a comment and i will add it, pm me, or email me.

Look at mouse

image_angle=point_direction(x,y,mouse_x,mouse_y)

Create an object where your object is standing.

instance_create(0,0,obj_object)

opens up/closes 3d mode

d3d_start()
d3d_end()

how to do the relative selection in code.

speed+=1
vspeed+=1
hspeed+=1

destroy

instance_destroy()

how to code with a keypress that is a letter

if key_press(ord_"W"))

How to do passwords

password = get_string("Please enter a password"", "" );

switch(password)
{
case "password 1" :
room_goto(rm_level_1);
break;
case "password 2":
room_goto(rm_level 2);
break;
default :
show_message("Password Invalid");
break;
}


(from gamemaker.wikicomplete.info)

go to next room

room_go_to_next()
avatar
3d
Admin
Admin

Posts : 1227
Points : 42366
GameML Reputation : 66
Join date : 2009-05-31
Age : 35
Location : U.S.A

View user profile http://gameml.iowoi.org

Back to top Go down

Re: Simple Codes by 3d

Post by -js1210- on Thu Jun 04, 2009 7:05 pm

This is for MAJOR n00bs. Except for the last few.
avatar
-js1210-
Super 500 GML
Super 500 GML

Posts : 1298
Points : 32732
GameML Reputation : 27
Join date : 2009-06-02
Age : 22
Location : United States

View user profile http://www.yoyogames.com/members/js1210

Back to top Go down

Re: Simple Codes by 3d

Post by 3d on Fri Jun 05, 2009 8:38 am

yeah. or ppl thats are AMAZING, but use D&D only.

_________________
Creator of GameML, Thanks for Visiting!
avatar
3d
Admin
Admin

Posts : 1227
Points : 42366
GameML Reputation : 66
Join date : 2009-05-31
Age : 35
Location : U.S.A

View user profile http://gameml.iowoi.org

Back to top Go down

Re: Simple Codes by 3d

Post by Time on Sun Jun 07, 2009 8:42 am

Easy value swapping (true becomes false, false becomes true):
Code:
boolean = !boolean
Easy gravity:
Code:
gravity = place_free(x, y+1);
Easy auto-tiling:
Code:
grid_x = argument0;
grid_y = argument1;
obj = argument2;
image_index = 1 * place_meeting(x, y + grid_y, obj) +
              2 * place_meeting(x, y - grid_y, obj) +
              4 * place_meeting(x + grid_x, y, obj) +
              8 * place_meeting(x - grid_x, y, obj);
...Used with a tileset like this:
Drawing a default sprite (pro)
Code:
draw_sprite_ext(sprite_index,image_index,x,y,image_xscale,image_yscale,image_angle,image_blend,image_alpha);
Drawing a default sprite (lite)
Code:
draw_sprite(sprite_index, image_index, x, y);
Text alignment (centered)
Code:
draw_set_valign(fa_center);
draw_set_halign(fa_center);
avatar
Time
GameML Noob
GameML Noob

Posts : 22
Points : 30691
GameML Reputation : 3
Join date : 2009-06-01
Age : 24

View user profile

Back to top Go down

Re: Simple Codes by 3d

Post by 3d on Sun Jun 07, 2009 8:53 am

correct.

_________________
Creator of GameML, Thanks for Visiting!
avatar
3d
Admin
Admin

Posts : 1227
Points : 42366
GameML Reputation : 66
Join date : 2009-05-31
Age : 35
Location : U.S.A

View user profile http://gameml.iowoi.org

Back to top Go down

Re: Simple Codes by 3d

Post by Desert Dog on Fri Jun 12, 2009 11:41 pm

3d, your code's have several errors in them. Hardly helpful to beginners, e.g.

it is room_goto_next() NOT room_go_to_next();

And it is NOT if key_press(ord_"W")), it is
if keyboard_check(ord('W')), there is not function called key_press.

And as for this

Create an object where your object is standing.

instance_create(0,0,obj_object)
This will only create an object in the top left hand corner of the room, try it.
If you want to create an object where you stand, do this.
Code:

instance_create(x,y,obj_object);

I hope this clears this up for you, we don't want to mis-inform/confuse beginners!
avatar
Desert Dog
GameML Noob
GameML Noob

Posts : 5
Points : 30542
GameML Reputation : 1
Join date : 2009-06-12

View user profile

Back to top Go down

Re: Simple Codes by 3d

Post by Sponsored content


Sponsored content


Back to top Go down

View previous topic View next topic Back to top

- Similar topics

 
Permissions in this forum:
You cannot reply to topics in this forum