Corrigindo bug de mouse
[Projeto-PCG.git] / weapon.cpp
blob114c72582c88a5738b1ec3765f00f59b307f100c
1 #include "weapon.h"
2 #include "shot.h"
3 #include "shotmanager.h"
4 #include "game.h"
6 void Weapon::desenha() {
7 sprite.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
13 //passar parametros
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));