| Revision 79,
978 bytes
checked in by knowknowledge, 4 years ago
(diff) |
|
Cleaned up the TAG game
Created two global tables: swarm and it to make things more packaged.
Pulled the decision making into a set of stand alone function 'plans'.
Each ship has their own plan, and since the plans are partially state
based, each ship moves unpredictably. This plan model could be adapted
to work for much more complex
Added a Window that gives live feedback on which ship is IT.
This window reflects the rotation of the IT ship.
Unlike the earlier version, users should be able to figure out what's
going on now. Like the earlier version, the AI do not do the smart
thing and just flee, since that would be boring.
|
| Line | |
|---|
| 1 | /* |
|---|
| 2 | * Filename : UI/ui_lua.h |
|---|
| 3 | * Author(s) : Matt Zweig (thezweig@gmail.com) |
|---|
| 4 | * Date Created : Thursday, October 29, 2009 |
|---|
| 5 | * Last Modified : Thursday, October 29, 2009 |
|---|
| 6 | * Purpose : Lua bridge for UI objects |
|---|
| 7 | * Notes : |
|---|
| 8 | */ |
|---|
| 9 | |
|---|
| 10 | #ifndef __H_UI_LUA |
|---|
| 11 | #define __H_UI_LUA |
|---|
| 12 | |
|---|
| 13 | #include <lua.h> |
|---|
| 14 | #include <lauxlib.h> |
|---|
| 15 | #include <lualib.h> |
|---|
| 16 | |
|---|
| 17 | #include "UI/ui.h" |
|---|
| 18 | #include "ui_label.h" |
|---|
| 19 | #include "ui_window.h" |
|---|
| 20 | #include "ui_button.h" |
|---|
| 21 | |
|---|
| 22 | class UI_Lua { |
|---|
| 23 | public: |
|---|
| 24 | // Functions to communicate with Lua |
|---|
| 25 | static void RegisterUI(lua_State *luaVM); |
|---|
| 26 | |
|---|
| 27 | // Functions to create new Widgets |
|---|
| 28 | static int newWindow(lua_State *luaVM); |
|---|
| 29 | static int newButton(lua_State *luaVM); |
|---|
| 30 | static int newLabel(lua_State *luaVM); |
|---|
| 31 | static int newPicture(lua_State *luaVM); |
|---|
| 32 | |
|---|
| 33 | // Functions to manipulate Widgets |
|---|
| 34 | static int add(lua_State *luaVM); |
|---|
| 35 | static int close(lua_State *luaVM); |
|---|
| 36 | static int rotatePicture(lua_State *luaVM); |
|---|
| 37 | static int setText(lua_State *luaVM); |
|---|
| 38 | private: |
|---|
| 39 | }; |
|---|
| 40 | #endif /*__H_UI_LUA*/ |
|---|
Note: See
TracBrowser
for help on using the repository browser.