3 #include "shotmanager.h"
6 void Weapon::desenha() {
10 void Weapon::fire(Ponto place
, double angle
) {
11 lua_pushlightuserdata(lstate
, (void *)this);
12 lua_gettable(lstate
, LUA_REGISTRYINDEX
);//obter funcao do script
14 lua_pushnumber(lstate
, place
.x
);
15 lua_pushnumber(lstate
, place
.y
);
16 lua_pushnumber(lstate
, angle
);
17 lua_pushlightuserdata(lstate
, this);
19 if (lua_pcall(lstate
,4,0,0) != 0) /* do the call */
20 printf("error: %s", lua_tostring(lstate
, -1));