wip 1
This commit is contained in:
@@ -0,0 +1,8 @@
|
||||
// Built-in script for the `crate` archetype (see kiln-core/src/builtin_scripts.rs).
|
||||
fn bump(me, dir) {
|
||||
push(me.x, me.y, dir.opposite); // Try to clear our target cell
|
||||
let tgt = dir.opposite.from_point(me.x, me.y);
|
||||
// This will silently-nop if tgt is occupied, and it will evaluate that after the push
|
||||
// (queue both right now, evaluate in that order after)
|
||||
teleport(me.id, tgt.x, tgt.y);
|
||||
}
|
||||
@@ -3,7 +3,7 @@
|
||||
// A gem is a grabbable collectible: walking onto it (or pushing it into the
|
||||
// player) fires this `grab()` hook instead of blocking. We bump the player's gem
|
||||
// count and remove ourselves from the board.
|
||||
fn grab(me) {
|
||||
fn bump(me, _dir) {
|
||||
alter_gems(1);
|
||||
die();
|
||||
}
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
//
|
||||
// A heart is a grabbable collectible: walking onto it fires `grab()` instead
|
||||
// of blocking. It restores 1 health and removes itself from the board.
|
||||
fn grab(me) {
|
||||
fn bump(me, _dir) {
|
||||
alter_health(1);
|
||||
die();
|
||||
}
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
// A gem is a grabbable collectible: walking onto it (or pushing it into the
|
||||
// player) fires this `grab()` hook instead of blocking. We bump the player's gem
|
||||
// count and remove ourselves from the board.
|
||||
fn grab(me) {
|
||||
fn bump(me, _dir) {
|
||||
let colors = [
|
||||
"red",
|
||||
"orange",
|
||||
|
||||
Reference in New Issue
Block a user