Hi!
I would GREATLY appreciate any help or advice that you could give me.
My problem is - I need a software that makes a light to turn on, then registers if the right button has been pushed and then, to send a signal another light to turn on.
Please, help me!!!! With any advice...

Dani AI

Generated

Practical implementation notes for 's demo. As suggested, pick a target platform and language first — that only changes API details. The core pattern is the same everywhere: track a single "active" cell, highlight it, and validate input events against that active index. Event-driven button callbacks are simplest in UI toolkits; a polling/update loop is common inside game engines.

Implementation outline:

  • Represent the board as an array (1D or 2D) and store an integer active.
  • Provide light(index) and unlight(index) helper functions.
  • On button-press handler compare the pressed index to active. If it matches, clear the current, pick the next active (random or deterministic), then light it.
  • Use a locked flag during transitions to ignore extra presses and prevent race conditions.

Minimal pseudocode:

active = pickInitial()
light(active)

onButtonPress(i):
  if locked or i != active:
    return
  locked = true
  unlight(active)
  active = pickNext()
  light(active)
  locked = false

Quick tips: debounce physical buttons (hardware or software), make UI updates on the main thread, log state changes during testing, and avoid re-selecting the same cell if undesired. Start with this simple loop for a working demo, then add timing, scoring, or visual polish.

Recommended Answers

All 2 Replies

Advice: Explain yourself more clearly.

What kind of system? What programming language? What kind of light?

Ok...
I have to make a game-quite simple one.
It's a board devided in squares. The game starts when one of the squares lights up. Then you have to step on it and after that another light should light up and the purpose is to follow the light by stepping on it.
As i have to make just some kind of a demo version, i thought that the easiest way would be these squares to be some kind of buttons. When you push the button it should register that it has been pushed and to send a signal that another light should light up.

The problem is that i have some how to program these buttons and lights to do the above mentioned things, but I don't know how...

I hope this explanation was better.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.