Jump to content


pixelpig

Member Since 26 Jul 2008
Offline Last Active Apr 19 2012 08:54 PM

Posts I've Made

In Topic: how do I get the colors window to pop up

16 April 2011 - 10:37 PM

I remember at one point I could press C and a colors window would pop up, and I could click on a color that I wanted and set it to a variable.
How do I get the colors window to pop up?
thanks for your help.

myCol=get_color(c_blue);

In Topic: Pitfall problems

16 April 2011 - 05:38 AM

I'm having an issue where if the player character's mask is the same size as the pit he is supposed to fall into, he occasionally runs right over it. This is because his feet start and end on top of the walls of the pit between the two frames that he runs over it. Here's an example: say the player has a mask width of 32 and the pit is 32 wide. His move speed is 6. He is standing at -2 relative to the pit's x position (so still not completely over it), and when he takes his next step he is standing at +4 relative to the pit, effectively stepping over it. Does anyone know of a code I could use to make it so his next step will put him in the same x position as the pit so that he will fall in it?

Presuming you know the pit's position(say px) then this'll work in step:
if((xprevious<px && px<x) || (xprevious>px && px>x)) {
//Fall code here (presumably x=px)
}

In Topic: Best way to flip./mirror a sprite?

07 April 2011 - 10:27 PM

So I know two methods to flip a sprite.

Method 1: Make a left and right version of the sprite and code it to switch based off of direction.

Method 2: Use image_scale = -1 and 1 to flip the image.

So I was wondering if there is a better way? Method 1 takes a lot of room and seems kind of sloppy. The problem with method 2 is it messes with my sprite mask and makes the collision kind of funky. EX: now when I run in to the wall I get stuck in a pixel or two.

You could just have the images on two separate sub-images.

In Topic: # Unknown Variable? #

06 March 2011 - 10:33 PM

The first draw event of a game is executed before the create event. In this case, use the xstart and ystart variables instead.

No it doesn't...the create event is still done before the draw event.

Information about object: object0

Sprite: <no sprite>
Solid: false
Visible: true
Depth: 0
Persistent: false
Parent: <no parent>
Mask: <same as sprite>

Create Event:
execute code:

text = "hello";


Draw Event:
execute code:

draw_text(0, 0, text);

works fine

Oh, really? Hmm.... I'm sure I read that somewhere

In Topic: # Unknown Variable? #

06 March 2011 - 10:00 PM

The first draw event of a game is executed before the create event. In this case, use the xstart and ystart variables instead.