• Hey Guest! Ever feel like entering a Game Jam, but the time limit is always too much pressure? We get it... You lead a hectic life and dedicating 3 whole days to make a game just doesn't work for you! So, why not enter the GMC SLOW JAM? Take your time! Kick back and make your game over 4 months! Interested? Then just click here!

GameMaker Can you make an "if and if" type of code (dnd)

M

MattB

Guest
Might sound a bit confusing, but can you make something like this.

If left not pressed, AND if right not pressed, AND if up not pres... e.t.c.

In DnD please!
Bit of a noob question.
Whatever.

(Edit: if you need more context don't be afraid to ask :D)
(Edit 2: never mind figured it out)
 
Last edited by a moderator:

Yal

šŸ§ *penguin noises*
GMC Elder
If you manage to figure out HOW you solve something, it's nice if you write about HOW you solved it as well so others with the same problem can learn from it.

Also, if you have a lot of "if not A, and not B, and not C" type things, you can get an easier time having the OPPOSITE logic: e.g, if not (left pressed or right pressed or up pressed..). So you can break out the "not" if you change every "and" into "or" and vice versa.

(Nerd trivia: this is called De Morgan's Law)
 

TheouAegis

Member
Also,

if not A and not B and not C and not D

is just multiple Test Variable actions all in a row.

Test not A
Test not B
Test not C
Test not D
Action

But the method Yal mentioned is more streamlined and faster.
 
Top