Compare commits
2 Commits
709a74a76a
...
9db783b3ac
| Author | SHA1 | Date | |
|---|---|---|---|
| 9db783b3ac | |||
| 2dcbdfa975 |
28
game.lua
28
game.lua
@@ -1,7 +1,33 @@
|
|||||||
|
Persona = {
|
||||||
|
name = "---",
|
||||||
|
}
|
||||||
|
|
||||||
|
function Persona:SayName()
|
||||||
|
print(self.name .. " ")
|
||||||
|
end
|
||||||
|
|
||||||
|
function Persona:new(obj)
|
||||||
|
obj = obj or {}
|
||||||
|
setmetatable(obj, self)
|
||||||
|
--self.__index = self
|
||||||
|
return obj
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
function init()
|
function init()
|
||||||
mode(0)
|
mode(0)
|
||||||
cls()
|
cls()
|
||||||
print("HOLA MUNDO!")
|
Persona.__index=Persona
|
||||||
|
persones={}
|
||||||
|
persones[1] = Persona:new({name="Persona1"})
|
||||||
|
persones[2] = Persona:new({name="Persona2"})
|
||||||
|
persones[3] = Persona:new({name="Persona3"})
|
||||||
|
persones[4] = Persona:new({name="Persona4"})
|
||||||
|
|
||||||
|
for i,v in ipairs(persones) do
|
||||||
|
v:SayName()
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
function update()
|
function update()
|
||||||
|
|||||||
1
lua.cpp
1
lua.cpp
@@ -422,6 +422,7 @@ const char boot[] = "function init()mode(1)cls()play('o5l0v5cegv4cegv3cegv2cegv1
|
|||||||
void lua_init(const char* filename, const bool start_playing) {
|
void lua_init(const char* filename, const bool start_playing) {
|
||||||
if (lua_state != STATE_STOPPED) lua_quit();
|
if (lua_state != STATE_STOPPED) lua_quit();
|
||||||
L = luaL_newstate();
|
L = luaL_newstate();
|
||||||
|
luaL_openlibs(L);
|
||||||
//init_exists = update_exists = false;
|
//init_exists = update_exists = false;
|
||||||
bool file_loaded = true;
|
bool file_loaded = true;
|
||||||
|
|
||||||
|
|||||||
@@ -4,6 +4,6 @@
|
|||||||
|
|
||||||
//extern "C" {
|
//extern "C" {
|
||||||
#include "lua.h"
|
#include "lua.h"
|
||||||
//#include "lualib.h"
|
#include "lualib.h"
|
||||||
#include "lauxlib.h"
|
#include "lauxlib.h"
|
||||||
//}
|
//}
|
||||||
|
|||||||
Reference in New Issue
Block a user