This is a read-only snapshot of the ComputerCraft forums, taken in April 2020.
andrewhopps's profile picture

Grid Menu?

Started by andrewhopps, 18 March 2013 - 01:34 AM
andrewhopps #1
Posted 18 March 2013 - 02:34 AM
I am looking for a way to make a grid menu with about 80 options. Each option is available on screen at the same time. This is going to be an easier Battleship so you don't have to remember where you placed wool blocks or took out radar guns. Would also like to change the color of individual options after selecting one, to indicate whether you hit or miss on that block. If that is not possible, I will just use monitors and change the background colors or something along those lines. I feel like this is well out of range for the standard tutorial and would like some help putting this together.
SuicidalSTDz #2
Posted 18 March 2013 - 03:23 AM
You will have to use tables defining the x and y pos of every position the other user sent through rednet to your computer. If you click an area of the screen that is a 'hit' point, it will return true.
andrewhopps #3
Posted 18 March 2013 - 03:46 AM
You will have to use tables defining the x and y pos of every position the other user sent through rednet to your computer. If you click an area of the screen that is a 'hit' point, it will return true.

The goal is to keep it minecraft and semiphysical

I want to use ICBM for the actual hit/miss actions, and have a yes/no menu asking if it was a hit or miss. After selecting yes or no, change the color accordingly. And a boolean wont work for 3 options such as hit, miss, not yet selected? I guess my major question would be how to properly nest my tables/buttons and their current colors.
SuicidalSTDz #4
Posted 18 March 2013 - 03:57 AM
local option = ""
repeat
if yes then
  option = hit
elseif no then
  option = miss
elseif nothing then
  option = nil
end
until option ~= nil
--missile launch if hit, else, do something else
remiX #5
Posted 18 March 2013 - 04:39 AM
Grid menu is more math involved, but try this: simple menu printing :P/>
It centers the text according to the longest string in the table.

For the colours… you can do that :P/>