Added slabs
This commit is contained in:
@@ -23,7 +23,8 @@ const (
|
||||
PlayerPlaceCooldown = 200 * time.Millisecond
|
||||
)
|
||||
|
||||
var placeId = [10]int{blocks.Stone, blocks.Dirt, blocks.Grass, blocks.LogOak, blocks.PlanksOak, blocks.LeavesOak, blocks.Glass, blocks.DebugDir, blocks.Bedrock, blocks.Water}
|
||||
var placeId = [10]int{blocks.Stone, blocks.Slab, blocks.Grass, blocks.LogOak, blocks.PlanksOak, blocks.LeavesOak, blocks.Glass, blocks.DebugDir, blocks.Bedrock, blocks.Water}
|
||||
var placeAux = [10]int{0, blocks.PlanksOak, 0, 0, 0, 0, 0, 0, 0, 0}
|
||||
var placei = 0
|
||||
|
||||
var logs string
|
||||
@@ -297,7 +298,11 @@ func (g *Game) Update(win *glfw.Window, delta time.Duration) {
|
||||
}
|
||||
|
||||
if canplace {
|
||||
g.world.SetBlock(bc.Add(itype.DirectionVeci[dir]), placeId[placei], 0, nil)
|
||||
aux := placeAux[placei]
|
||||
if win.GetKey(glfw.KeyLeftShift) == glfw.Press {
|
||||
aux = -aux
|
||||
}
|
||||
g.world.SetBlock(bc.Add(itype.DirectionVeci[dir]), placeId[placei], aux, nil)
|
||||
g.player.SetDatasetI("LastPlace", int64(g.runtime))
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user