Not obstacle thicket and basic component tut please ?
Posted: Fri Oct 31, 2014 9:08 pm
I am not really easy with components yet. I would like to create a thicket that is not an obstacle. What am I doing wrong here please ?
defineObject{
name = "beach_thicket_damaged_crom",
baseObject = "beach_thicket_damaged",
components = {
{
class="Clickable",
onClick=function(self)
if math.random()<0.3 then
setMouseItem(spawn('branch').item)
hudPrint("You recover a branch from this damaged thicket.")
self.go:destroy()
end
if math.random()<0.5 then
self.go:spawn("beach_thicket_broken")
self.go:destroy()
hudPrint("This thicket is destroyed now !")
end
end
},
{
class="Obstacle",
obstacleComponent:setBlockParty(false)
}
}
}
defineObject{
name = "beach_thicket_damaged_crom",
baseObject = "beach_thicket_damaged",
components = {
{
class="Clickable",
onClick=function(self)
if math.random()<0.3 then
setMouseItem(spawn('branch').item)
hudPrint("You recover a branch from this damaged thicket.")
self.go:destroy()
end
if math.random()<0.5 then
self.go:spawn("beach_thicket_broken")
self.go:destroy()
hudPrint("This thicket is destroyed now !")
end
end
},
{
class="Obstacle",
obstacleComponent:setBlockParty(false)
}
}
}