Jump to content


FruitPlusVeggies

Member Since 02 May 2009
Offline Last Active Jul 07 2011 05:46 AM

Topics I've Started

Save all tiles in the room as a background file

29 June 2011 - 07:14 PM

Let's say I have a room and I have placed a bunch of tiles inside.
Is there a way I can make it so Game Maker takes all of these tiles in the room (just the tiles), and saves it into
a background.png file? The rest of the room being transparent in the background file of course.

And no, I don't mean manually printing the screen in the room editor and doing it in photoshop,
I want to know if there is a way I can do this all in GML.

YoyoGames Copyright files

18 May 2011 - 03:48 AM

I'm just wondering if the files included with Game Maker 8 like the resources and the sounds, are copyright?
Like would I be able to produce a game and sell it without giving credit to yoyogames and not be sued?

GM - Porting to other devices

14 May 2011 - 03:24 AM

When they finally allow us to port game maker games to other devices, will we:
- Be able to send them to the app store using our own Apple Dev account and make money?
- Have to credit Game Maker/yoyo games if we make money off of it? (considering the answer to the first question is yes)
- Be able to get rid of the yoyo games logo that appears when you start an app?
- Be able to use dll files? Such as 39dll?

2D Box Collision - Manual

25 April 2011 - 05:19 AM

Hey guys.
I'm trying to make my own physics (2D box collision) from scratch and I am so close to finishing it.

If you don't understand what I mean, basically I'm just checking if my player hits the sides, top, or bottom
of a block, and if it does, push it to the outside. Simple enough.

Anyways, I'm extremely close to finishing it, there's just one problem.
If I have a block alone, all the sides work perfectly, however, if I have two blocks side by side,
and I start on the right block, going left, if I hit the side of it, my player stops?

I've decided to upload my .gmk file (made with Game Maker 8).
Please excuse the messy code because this is just a test-case.
http://www.2shared.com/file/x-qc67D-/TestCase.html

The "physics" code can be found in object: player Draw event.
If you don't feel like downloading it, here's the step event code:
if(keyboard_check_pressed(vk_up) && jumpstate=="ground"){
jumpstate = "jumping"; 
vsp = -jump_impulsion;
}


if(motion=="left") || (keyboard_check(vk_left)){
hsp=-p_maxspeed; dir=-1;
}
if(motion=="right") || (keyboard_check(vk_right)){
hsp=+p_maxspeed; dir=1;
}
if(motion=="idle") || (keyboard_check_released(vk_left) || keyboard_check_released(vk_right)){
hsp=0; dir=0;
}


if(vsp>=0){
jumpstate = "falling";
}

if(vsp>14) vsp=14;

if(y+vsp>=300){
y=300;
vsp=0;
 jumpstate = "ground";
}


vsp+=grav;

//READ HERE\\\\\\\\\\\\\\\\\\\\\\\\\\

for(i = 0; i<instance_number(obj); i+=1){
b = instance_find(obj,i);

//Check if we are on the sides
if(y + height + vsp >= b.y+1 && y + vsp <= b.y+b.height)
{
    //Right side
    if(x + hsp < b.x+b.width+1  && x + hsp > b.x+b.width + hsp-1  && dir==-1)
    {
     x = b.x + b.width; hsp = 0;
    }
    //Left side    
    if(x + width + hsp >= b.x +1 && x + width + hsp <= b.x + hsp + 2 && dir==1)
    {
     x = b.x - width; hsp = 0;
    }
}

//Check if we are on the top or the bottom
if(x + width + hsp >= b.x+2 && x + hsp <= b.x+b.width-2){
    if(y + height + vsp >= b.y && y + height + vsp <= b.y + vsp + 1 && jumpstate=="falling")
        {
        y = b.y - height; jumpstate="ground"; vsp = 0;
        }
    
    if(y + vsp <= b.y + b.height && y + vsp >= b.y + b.height + vsp + 1 && jumpstate=="jumping")
    {
    y = b.y + b.height; jumpstate="falling"; vsp = 0;
    }
}

}

x+=hsp;
y+=vsp;

Play the game and start moving left and you will see what I mean.
It's very strange because it works when I move right, just not left.
If I just have a standalone box though, everything works as it should.

I believe the problem arises where the code marks: "//Right side" when I'm checking the right side of the block.

Execute things while GM window is not focused

14 March 2011 - 11:04 PM

Let's say I want to copy something to the clipboard.
In my game I have it so that when I press the "1" key, it will copy a string to the clipboard:
"Hello"
or when I press "2": "Hey there"
or when I press "3": "How are you doing?"
and so on...

How would I do this if I clicked out of the window? I want it so even if I'm out of the window,
it still copies it to the clipboard/executes GM functions.