Changeset 76 for Utilities/lua.cpp


Ignore:
Timestamp:
11/02/09 02:37:54 (4 years ago)
Author:
knowknowledge
Message:

Tag In Space

AI Scripts for Space Tag where one ship hunts while the rest try to run.
The player is included.
When the AI run, they don't run directly away because that would be
boring. Instead they randomly decide to follow one of a few directions.

Unfortunately, the only way to tell what's going on is to turn on the
in-game console, which cut my FPS to a third of normal.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • Utilities/lua.cpp

    r74 r76  
    1717#include "UI/ui_label.h" 
    1818#include "UI/ui_button.h" 
     19#include "Sprites/Player.h" 
    1920 
    2021bool Lua::luaInitialized = false; 
     
    148149                {"pause", &Lua::pause}, 
    149150                {"unpause", &Lua::unpause}, 
     151                {"player", &Lua::getPlayer}, 
    150152                {NULL, NULL} 
    151153        }; 
     
    178180        return 0; 
    179181} 
     182 
     183int Lua::getPlayer(lua_State *luaVM){ 
     184        Player **player = (Player**)lua_newuserdata(luaVM, sizeof(Player*)); 
     185        *player = Player::Instance(); 
     186        return 1; 
     187} 
Note: See TracChangeset for help on using the changeset viewer.