Skip to content

Snippets

Daniel Báez edited this page Sep 8, 2024 · 7 revisions

KAPLAYGROUND provides some snippets for your usage, them are prefixed with k-

  • k-obj: An object add() in a constant
  • k-init: kaplay() function with also a loadBean(), great for starting.
  • k-add: A raw add() statement.
  • k-arrows: Four onKeyPress() arrow handlers.
  • k-arrows-down: Four onKeyDown() arrow handlers.
  • k-onKeyPress: An onKeyPress() event
  • k-onKeyDown: An onKeyDown() event
  • k-onKeyRelease: An onKeyRelease() event
  • k-onUpdate: An onUpdate() event
  • k-debug: Add the debug mode debug.inspect = true
  • k-onLoad: An onLoad() event
  • k-level: An object (addLevel()) in a constant (with a mini ascii map and config example)
  • k-scene: A raw scene() function
  • k-onCollide: An onCollide() event for 2 tags
Clone this wiki locally