# How do I create a dual n-back game?

0 Favourites
• 8 posts
• Hi!

I have tried creating a dual n-back game. For those of you familiar with the dual n-back game you know that when a certain object overlaps a square every nth time you are supposed to press a button in order to get points as a correct answer. I have tried to do this in various ways, with variables etc but it just doesn't seem to work. All thoughts are much appreciated!

• ## Try Construct 3

Develop games in your browser. Powerful, performant & highly capable.

Construct 3 users don't see these ads
• Not familiar with a dual n-back game.

But it sounds like you should use an incrementing counter variable.

| Global number NthTime = 5

+ CertainObject: On collision with Square

-> Square: Add 1 to collisionCount

+ Button: On clicked

+ System: Square.collisionCount%NthTime = 0

+ System: Square.collisionCount ? 0

-> Function: Call "getPoints" ()

For reference, % gives you the remainder after division, which is what you need to use for every x overlaps. So if it is set to 5, that condition will be true when collisionCount = 0,5,10,15 ect. (then add an additional condition to make it not true when 0)

You might need to add a system to disable the event after points have been awarded for each tier.

• I may have misinterpreted you but it sounds like you are suggesting pretty much what I have tried already.

Perhaps if you could be so kind and check out this link with a functioning version of the game you will see my problem. brainscale.net/dual-n-back/training

• use arrays to save all shown tiles (and sounds if your game supports that too) and a global variable(ie :Counter) to save count of tiles shown till now so when it wants to check 2 3 or x steps before, check Array[Counter-x] = Array[Counter] when user touches the shown tile, if true user gets the point.

• Hmmm, I have never used arrays, but I will try and see if it does the trick! Thanks!

• To be fair what you are saying pooya72 does seem to make a lot of sense but since I have never used arrays before I don't know how to make it happen. If you would be so kind and explain more in detail how to do it that would be most appreciated!

• I have tried with the arrays but I really can't figure out how to make it happen so if anyone can give me advice on this I would appreciate it a lot!

• I didn't checked this thread after posting the last respond, do you still have that problem ?

if i didn't respond again email me at irhkatseofn@27ayoop followed by .com