Examples
Player: {
power: 20
life: 100
Event: Enter_Room {
if (currentRoom() == char.currentRoom()){
// If player and char are in the same room
if (rand(0,power) < rand(0,char.power)){
// Then if player rolls a power less than char
life -= char.power
if (life <= 0)
endGame()
// Ends game if player died from the hit
}
else{
char.life -= power
if (char.life <= 0){
char.dropItems()
char.remove()
// If char dies from the hit, it drops all items and is removed
}
}
}
}
}