Welcome, Guest. Please login or register.

Login with username, password and session length

 
Advanced search

1411126 Posts in 69302 Topics- by 58376 Members - Latest Member: TitanicEnterprises

March 13, 2024, 02:22:54 PM

Need hosting? Check out Digital Ocean
(more details in this thread)
  Show Posts
Pages: [1]
1  Developer / Technical / Re: Help with random() for roguelike on: May 18, 2013, 01:10:29 AM
you need to call randomize() in every random function you will use, it will give a different seed each time you use it.

GM uses the same seed for debugging purposes.
2  Community / Tutorials / Re: Game Maker Tuts on: April 05, 2013, 01:24:47 AM
I know theres a more easy way to generate dungeons, but this is the first generator that I've made.

Here it is -

obj_generator ->
Quote
//Initial Coords
x = 0;
y = 0;

grid_size = 16;  // must be even number
map_size = 400;  // must be even number

//center of the map
x = (map_size*grid_size) div 2;
y = (map_size*grid_size) div 2;

//make sure you are on aligned on grid
move_snap(grid_size,grid_size);


randomize(); // gamemaker isnt really random as you would think, so you need this

starting_room = choose(1,2,3);
scr_rooms(starting_room,grid_size);
instance_create(x,y,obj_start);
instance_create(0,0,obj_hud);
instance_create(x,y,obj_player);

// Random Number of Rooms
randomize();
room_num = choose((map_size/2)-20,(map_size/2));

//Start Creating Dungeon
//repeat(room_num)
for(room_i = 0; room_i <= room_num; room_i +=1)
{
    scr_hall();
    scr_hall();
   
    randomize();
    create_room = choose(1,2,3,4);
    if(room_i = room_num)
    {
        instance_create(x,y,obj_center);
        scr_rooms(4,grid_size);
    }
    else
    {
        instance_create(x,y,obj_center);
        scr_rooms(create_room,grid_size);
    }
}



view_follow[0] = obj_start;

scr_floor() ->

Quote
x_coord = argument0;
y_coord = argument1;

if(!position_meeting(x_coord,y_coord,obj_floor))
{
    instance_create(x_coord,y_coord,obj_floor);
}

scr_walls() ->
Quote
//  XXX
//  XoX
//  XXX


if(!instance_position(x-16,y-16,obj_wall) and !instance_position(x-16,y-16,obj_floor))
{
    instance_create(x-16,y-16,obj_wall);
}

if(!instance_position(x,y-16,obj_wall) and !instance_position(x,y-16,obj_floor))
{
    instance_create(x,y-16,obj_wall);
}

if(!instance_position(x+16,y-16,obj_wall) and !instance_position(x+16,y-16,obj_floor))
{
    instance_create(x+16,y-16,obj_wall);
}

if(!instance_position(x+16,y,obj_wall) and !instance_position(x+16,y,obj_floor))
{
    instance_create(x+16,y,obj_wall);
}

if(!instance_position(x+16,y+16,obj_wall) and !instance_position(x+16,y+16,obj_floor))
{
    instance_create(x+16,y+16,obj_wall);
}

if(!instance_position(x,y+16,obj_wall) and !instance_position(x,y+16,obj_floor))
{
    instance_create(x,y+16,obj_wall);
}

if(!instance_position(x-16,y+16,obj_wall) and !instance_position(x-16,y+16,obj_floor))
{
    instance_create(x-16,y+16,obj_wall);
}

if(!instance_position(x-16,y,obj_wall) and !instance_position(x-16,y,obj_floor))
{
    instance_create(x-16,y,obj_wall);
}


scr_rooms() ->

Quote
room_type = argument0;
grid_size = argument1;


if(room_type = 1)
{
    //3x3
    x_start = x-grid_size;
    y_start = y-grid_size;
   
    for(a=0; a<=2; a+=1)
    {
        for(b=0; b<=2; b+=1)
        {
            if(!position_meeting(x_start+(grid_size*a),y_start+(grid_size*b),obj_floor))
            {
                //instance_create(x_start+(grid_size*a),y_start+(grid_size*b),obj_floor);
                scr_floor(x_start+(grid_size*a),y_start+(grid_size*b));
               
            }
        }
    }
}
else if(room_type = 2)
{
    //3x4
    x_start = x-grid_size;
    y_start = y-grid_size;
   
    for(a=0; a<=2; a+=1)
    {
        for(b=0; b<=3; b+=1)
        {
            if(!position_meeting(x_start+(grid_size*a),y_start+(grid_size*b),obj_floor))
            {
                //instance_create(x_start+(grid_size*a),y_start+(grid_size*b),obj_floor);
                scr_floor(x_start+(grid_size*a),y_start+(grid_size*b));
               
            }
        }
    }
    randomize();
    new_coord = choose(1,2);
    y = y+(grid_size*new_coord);
}
else if(room_type = 3)
{
    //4x3
    x_start = x-grid_size;
    y_start = y-grid_size;
   
    for(a=0; a<=3; a+=1)
    {
        for(b=0; b<=2; b+=1)
        {
            if(!position_meeting(x_start+(grid_size*a),y_start+(grid_size*b),obj_floor))
            {
                //instance_create(x_start+(grid_size*a),y_start+(grid_size*b),obj_floor);
                scr_floor(x_start+(grid_size*a),y_start+(grid_size*b));
               
            }
        }
    }
    randomize();
    new_coord = choose(1,2);
    x = x+(grid_size*new_coord);
}
else if(room_type = 4)
{
    //5x5
    x_start = x-grid_size;
    y_start = y-grid_size;
   
    for(a=0; a<=4; a+=1)
    {
        for(b=0; b<=4; b+=1)
        {
            if(!position_meeting(x_start+(grid_size*a),y_start+(grid_size*b),obj_floor))
            {
                //instance_create(x_start+(grid_size*a),y_start+(grid_size*b),obj_floor);
                scr_floor(x_start+(grid_size*a),y_start+(grid_size*b));
               
            }
        }
    }
    randomize();
    new_dir = choose(0,1,2,3);
    switch(new_dir)
    {
        case 0:
        x = x+(grid_size*2)
        break;
       
        case 1:
        y = y+(grid_size*2)
        break;
       
        case 2:
        x = x-(grid_size*2)
        break;
       
        case 3:
        y = y-(grid_size*2)
        break;
    }
}

scr_hall() ->

Quote
randomize();
    choose_dir = choose(0,1,2,3);
    randomize();
    choose_dis = choose(4,7,7);
    switch(choose_dir)
    {
        case 0:
        repeat(choose_dis)
        {
            x = x+grid_size;
            scr_floor(x,y);
        }
        break;
       
        case 1:
        repeat(choose_dis)
        {
            y = y+grid_size;
            scr_floor(x,y);
        }
        break;
       
        case 2:
        repeat(choose_dis)
        {
            x = x-grid_size;
            scr_floor(x,y);
        }
        break;
       
        case 3:
        repeat(choose_dis)
        {
            y = y-grid_size;
            scr_floor(x,y);
        }
        break;
    }

3  Community / Tutorials / Re: Game Maker Tuts on: April 01, 2013, 07:34:01 AM
I managed to create a simple random dungeon creator on studio.

I'll be posting a tutorial soon, either here or on my blog.

Algo: same hall length, same room size

geen dot - starting point
red dot - end point

Screenshot
4  Developer / Technical / Re: Simple way to make doors between rooms on: March 30, 2013, 06:11:19 AM
or create one huge room which will contain all of your rooms

then use viewports
5  Developer / Art / Re: Mockups, or the "Please say this is going to be a game" thread on: March 13, 2013, 09:44:12 AM
Based by the amount of screen space allotted to each element, I'd say inventory/stats are the primary focus of the game? And the dungeon view is the least?

thanks, I'll have to re-evaluate it
6  Developer / Art / Re: Mockups, or the "Please say this is going to be a game" thread on: March 13, 2013, 07:23:24 AM
Guys, what  do you think of this mock-up??



I'm using Oryx's sprites.

Any suggestions?
7  Community / Tutorials / Re: GM Studio - little skull and swords fucking up my resources on: March 09, 2013, 04:44:34 AM
Never happened to me,

why not contact the support of yoyogames?

they will ask some details about your copy for verification.  Well, hello there!
8  Community / Assemblee: Part 1 / Re: Oryx - LOFI Fantasy 2D/3D [FINAL] on: February 26, 2013, 02:18:35 AM
@oryx - I tried to buy the fantasy sprite set but the checkout page only accepts credit cards. I only have paypal.
9  Developer / Technical / Just got in to Gamemaker Studio Closed Beta on: February 29, 2012, 03:13:19 AM
My first impression, although it has the same interface with GMHTML5 it runs a lot faster and runs a lot smoother.

Now it can create IOS and andriod games, but you will need to install the necessary SDKs.

Will be updating this for more infos  Wink

Anyone else that have access?
10  Community / Tutorials / Re: High Score Lists in Game Maker! on: November 21, 2011, 10:29:39 PM
you can create a variable that will stop the loop and place it in an IF statement

like

stop_loop = 0; // 1 - go on ; 0 - stop
11  Community / Tutorials / Re: I wanna make another GM tut! on: October 22, 2011, 09:12:02 AM
how about a tut for isometric games?

jumping into platforms, moving, placing tiles, etc.
Hmm... Seems interesting. Like isometric platformers/action games (XYZ) or topdown game with isometric perspective?(XY, fake perspective)

yeah, I wanted to create my personal final fantasy tactics/LAN  Well, hello there!
12  Community / Tutorials / Re: I wanna make another GM tut! on: October 22, 2011, 06:55:31 AM
how about a tut for isometric games?

jumping into platforms, moving, placing tiles, etc.
13  Developer / Technical / Re: Game Maker For Beginners: Part I on: October 19, 2011, 04:03:45 AM
I'm having trouble doing this with the new version of Game Maker. Is there an updated version?

what version are you talking about?

GM 8.1

or

GM HTML5 ??
14  Community / Tutorials / Re: Simple Motion blur (Well motion trail actually) on: September 03, 2011, 01:12:52 AM
great tut!!

I could use this as a booster for my vertical space shooter.  Smiley
Pages: [1]
Theme orange-lt created by panic