initial commit

master
cornernote 2014-12-15 17:20:16 +10:30
parent 130e075291
commit edcf259e52
6 changed files with 114 additions and 3 deletions

32
LICENSE Normal file
View File

@ -0,0 +1,32 @@
Copyright (c) 2013, Brett O'Donnell http://cornernote.github.io
All rights reserved.
_____ _____ _____ _____ _____ _____
| |___| __ | | |___| __ | | |___|_ _|___
| --| . | -| | | | -_| -| | | | . | | | | -_|
|_____|___|__|__|_|___|___|__|__|_|___|___| |_| |___|
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright notice, this
list of conditions and the following disclaimer in the documentation and/or
other materials provided with the distribution.
* Neither the name of the organization nor the names of its
contributors may be used to endorse or promote products derived from
this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

View File

@ -1,4 +1,51 @@
minetest-ox_lc
==============
# Naughts and Crosses - LuaController for Minetest
Naughts and Crosses - LuaController for Minetest
Create a game of Naughts and Crosses
![Screenshot](https://raw.githubusercontent.com/cornernote/minetest-ox_lc/master/screenshot.png "Naughts and Crosses")
## Depends
* [mesecons](https://github.com/Jeija/minetest-mod-mesecons)
* [digilines](https://github.com/Jeija/minetest-mod-digilines)
## Items Required
- 100x LuaController (mesecons_luacontroller:luacontroller)
- 19x Button (mesecons_button:button_off)
- 81x Lightstone (???)
- 150x (approx) Digilines Wire (digilines:wire_std)
## How-To
- Place 9 LuaControllers for each player (see [button_controller.lua](https://github.com/cornernote/minetest-ox_lc/blob/master/button_controller.lua))
- Place 1 LuaController for the reset button (see [reset_controller.lua](https://github.com/cornernote/minetest-ox_lc/blob/master/reset_controller.lua))
- Place a Button in front of each of the button controllers and the reset controller.
- Place 9 LuaControllers for each of the 9 displays (see [display_controller.lua](https://github.com/cornernote/minetest-ox_lc/blob/master/display_controller.lua))
- Place a Lightstone in front of each of the display controllers
- Connect everything with Digilines Wire
## Resources
- **[GitHub Project](https://github.com/cornernote/minetest-ox_lc)**
- **[Forum Page](https://forum.minetest.net/viewtopic.php?t=???)**
## Support
- Does this README need improvement? Go ahead and [suggest a change](https://github.com/cornernote/minetest-ox_lc/edit/master/README.md).
- Found a bug, or need help using this project? Check the [open issues](https://github.com/cornernote/minetest-ox_lc/issues) or [create an issue](https://github.com/cornernote/minetest-ox_lc/issues/new).
## About
This module is open source, so it's distributed freely. If you find it useful then I ask not for your wealth, but simply to spare your time to consider the world we share by watching [Earthlings](http://earthlings.com/), a multi-award winning film available to watch online for free. A must-see for anyone who wishes to make the world a better place.
## License
[BSD-3-Clause](https://raw.github.com/cornernote/minetest-ox_lc/master/LICENSE), Copyright © 2013-2014 [Brett O'Donnell](http://cornernote.github.io/)

10
button_controller.lua Normal file
View File

@ -0,0 +1,10 @@
--
-- Button Controller
--
position = "1-1" -- set to: "1-1", "1-2", "1-3", "2-1", "2-2", "2-3", "3-1", "3-2" or "3-3" based on the position of the button
player = "O" -- set to: "O" or "X" based on the player
if (event.type=="on") then
digiline_send(position, player)
end

15
display_controller.lua Normal file
View File

@ -0,0 +1,15 @@
--
-- Display Controller
--
position = "1-1" -- set to: "1-1", "1-2", "1-3", "2-1", "2-2", "2-3", "3-1", "3-2" or "3-3" based on the position of the display
player = "O" -- set to: "O" or "X" based on the player
port_id = "d" -- set to: "a", "b", "c" or "d" based on the direction to the lightstone
if (event.type=="digiline") then
if (event.channel==position) then
if (event.msg==player) then port[port_id] = true else port[port_id] = false end
elseif (event.channel=="reset") then
port[port_id] = false
end
end

7
reset_controller.lua Normal file
View File

@ -0,0 +1,7 @@
--
-- Reset Controller
--
if (event.type=="on") then
digiline_send("reset", "reset")
end

BIN
screenshot.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 362 KiB