add drop.json
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"items": [
|
||||
"bazalt_breaker"
|
||||
"entities": [
|
||||
"drop"
|
||||
],
|
||||
"blocks": [
|
||||
"dirt",
|
||||
@@ -27,5 +27,8 @@
|
||||
"lightbulb",
|
||||
"torch",
|
||||
"wooden_door"
|
||||
],
|
||||
"items": [
|
||||
"bazalt_breaker"
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
{
|
||||
"hitbox": [0.2, 0.2, 0.2]
|
||||
}
|
||||
@@ -5,7 +5,7 @@ function on_hud_open()
|
||||
input.add_callback("player.drop", function ()
|
||||
local pid = hud.get_player()
|
||||
local pvel = {player.get_vel(pid)}
|
||||
local eid = entity.test()
|
||||
local eid = entity.spawn("base:drop")
|
||||
local throw_force = vec3.mul(player.get_dir(pid), DROP_FORCE)
|
||||
entity.set_vel(eid, vec3.add(throw_force, vec3.add(pvel, DROP_INIT_VEL)))
|
||||
end)
|
||||
|
||||
Reference in New Issue
Block a user