Function
chance
(p: number): booleanrand(1) <= p
// every frame all objs with tag "unlucky" have 50% chance die
onUpdate("unlucky", (o) => {
if (chance(0.5)) {
destroy(o)
}
})
group
Math
rand(1) <= p
// every frame all objs with tag "unlucky" have 50% chance die
onUpdate("unlucky", (o) => {
if (chance(0.5)) {
destroy(o)
}
})
group
Math
Assets
Game Obj
Components
Component Types
Scene
Input
Events
Info
Math
Layer
Camera
Layers
Level
Draw
Plugins
Button Bindings
GFX
Miscalenous