forked from mtcontrib/spears
alpha2
This commit is contained in:
parent
4826788d02
commit
2411a9d433
@ -3,9 +3,9 @@ function spears_shot (itemstack, player)
|
|||||||
local playerpos = player:getpos()
|
local playerpos = player:getpos()
|
||||||
local obj = minetest.add_entity({x=playerpos.x,y=playerpos.y+1.5,z=playerpos.z}, spear)
|
local obj = minetest.add_entity({x=playerpos.x,y=playerpos.y+1.5,z=playerpos.z}, spear)
|
||||||
local dir = player:get_look_dir()
|
local dir = player:get_look_dir()
|
||||||
local sp = .14
|
local sp = 14
|
||||||
local dr = 0-- .2
|
local dr = .3
|
||||||
local gravity = 0--9.8
|
local gravity = 9.8
|
||||||
obj:setvelocity({x=dir.x*sp, y=dir.y*sp, z=dir.z*sp})
|
obj:setvelocity({x=dir.x*sp, y=dir.y*sp, z=dir.z*sp})
|
||||||
obj:setacceleration({x=-dir.x*dr, y=-gravity, z=-dir.z*dr})
|
obj:setacceleration({x=-dir.x*dr, y=-gravity, z=-dir.z*dr})
|
||||||
obj:setyaw(player:get_look_yaw()+math.pi)
|
obj:setyaw(player:get_look_yaw()+math.pi)
|
||||||
|
Loading…
Reference in New Issue
Block a user