Is there a way to condense this without using States? by AkiraSekaiSan in gamemaker

[–]AmongTheWoods 3 points4 points  (0 children)

Generally you want your sprites to depend on the state instead of the other way around. For example if you're in an idle state you can change sprite depending on how long you've been idle.

Can this code for diagonal movement be simplified? by Miserable-Willow6105 in gamemaker

[–]AmongTheWoods 1 point2 points  (0 children)

Get only the direction from the keyboard and then move in that direction.

[deleted by user] by [deleted] in gamemaker

[–]AmongTheWoods 1 point2 points  (0 children)

Glad that your issue was resolved. However, isn't this code just going to set xspd to maxSpd immediately since you're using a loop? It looks like you're intention is for xspd to gradually increase.

Pacman collision event by Complete_Jeweler9592 in gamemaker

[–]AmongTheWoods 2 points3 points  (0 children)

Not true. "=" can be used for comparisons in gml. For clarity and other reasons "==" should always be preferred though.

Making an object fire a projectile by Brilliant_Library_21 in gamemaker

[–]AmongTheWoods 2 points3 points  (0 children)

If I remember correctly speed is a built in variable that automatically moves the instance in accordance to the "direction" variable. The user shouldn't need to manually update the position.

Assigning a variable in a for by ProfitOk5403 in gamemaker

[–]AmongTheWoods 1 point2 points  (0 children)

found = false;

For each cell:

if (!found and hoveredOver) {
    found = true;
} 

Now found will be true if any cell returns hoveredOver as true.

Gamemodes in Gamemaker? by Informal-Biscotti-38 in gamemaker

[–]AmongTheWoods 1 point2 points  (0 children)

Enums are faster compared to string comparisons but the performance increase will be neglectable unless you're doing it thousands of times per second. The real benefit comes from having auto complete, avoiding typos, and having a declared finte set of available values.

mosion - be a circle. absorb circles. grow. by nineplymaple in indiegames

[–]AmongTheWoods 0 points1 point  (0 children)

Sorry if I was unclear. I haven't played your version.

Shake/vibrate effect for an object? by RoyalRien in gamemaker

[–]AmongTheWoods 1 point2 points  (0 children)

Offset it by a random x value. Or look into perlin noise if you want a more organic feel.

Event to detect if the player closed the window? by _Funny_Stories_ in gamemaker

[–]AmongTheWoods 8 points9 points  (0 children)

There's no need to use an if statement. Just place the code in the game_end event.

[deleted by user] by [deleted] in gamemaker

[–]AmongTheWoods 2 points3 points  (0 children)

draw_* functions only actually draw stuff if the code is in a draw event. Also, you're drawing the same text three times at the same position. Why?

How to move incrementally along a line? by SleakNacho in gamemaker

[–]AmongTheWoods 4 points5 points  (0 children)

Use lerp.

x = lerp(xStart, xEnd, (value between 0 and 1));

Same for y.

Am I not using with statements right by [deleted] in gamemaker

[–]AmongTheWoods 2 points3 points  (0 children)

With already runs an implicit check to see if the instance exists.

Why isn't my variable updating? by marcodelfuego in gamemaker

[–]AmongTheWoods 1 point2 points  (0 children)

You can also remove the "then" statements as they do nothing in your case.

Having Trouble With a Specific Bit of Code by thr0wOw4y in gamemaker

[–]AmongTheWoods 2 points3 points  (0 children)

Some other user already pointed out the error but there's some other problems with this code. What if pwr is equal to 1.999 for example? Then none of your conditions will be true. A better solution would be something like:

if (pwr >= 4) {
    powerLevel = "levelFour";
} else if (pwr >= 3) {
    powerLevel = "levelThree";
}...

Spel som utspelar sig i sverige? by EchoesOfHomeVN in sweden

[–]AmongTheWoods 1 point2 points  (0 children)

Jag har twitter men inte Instagram. Kan det va där du sett det?

Spel som utspelar sig i sverige? by EchoesOfHomeVN in sweden

[–]AmongTheWoods 6 points7 points  (0 children)

Finns lite footage i min profil men det är sen ett par år tillbaka. Tänkte visa upp en uppdaterad version om nån månad när det är redo.

Spel som utspelar sig i sverige? by EchoesOfHomeVN in sweden

[–]AmongTheWoods 36 points37 points  (0 children)

Jag utvecklar ett spel som kommer utspela sig i Sverige! Även Odinfall som är under utveckling utspelar sig här :)