This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Ember from 'ember'; | |
export default Ember.Controller.extend({ | |
appName: 'Ember Twiddle', | |
init() { | |
this._super(...arguments); | |
// this.foo = { bar: { baz: 4 } }; | |
let foo = Ember.Object.create(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Imperative, immediate-mode API. (Inspired by PICO-8.) | |
function _init() { | |
} | |
function _update() { | |
} | |
function _draw() { | |
cls(Color.Blue); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
u=64 | |
x,y=u,u | |
es={} | |
c=circfill | |
f=abs | |
q=3 | |
g=0 | |
p=cos | |
o=sin | |
function _update() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- [ ] swing | |
- [ ] blow | |
- [ ] shake whipped cream / screenshake | |
- [ ] wash dishes | |
- [ ] cut / chop | |
- [ ] roll | |
- [ ] punch | |
- [ ] blow up | |
- [ ] cook (by breathing fire) | |
- [ ] jump |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pico-8 cartridge // http://www.pico-8.com | |
version 16 | |
__lua__ | |
-- here's a simple player class: | |
function player(o) | |
return { | |
x=64, | |
y=64, | |
on_input=o.on_input, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const verbs = [ | |
'move horizontally', | |
'raise sword', | |
'lower sword', | |
'thrust sword', | |
] | |
const objects = [ | |
'fencer with sword', | |
'piste', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function weighted_choice(choices) | |
local total_weight = 0 | |
local thresholds = {} | |
for choice, weight in pairs(choices) do | |
add(thresholds, {total_weight, choice}) | |
total_weight += weight | |
end | |
local selection = rnd(total_weight) | |
for i=1,#thresholds-1 do |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function rrectfill(x0, y0, x1, y1, col, corners) | |
local tl = corners and corners.tl | |
local tr = corners and corners.tr | |
local bl = corners and corners.bl | |
local br = corners and corners.br | |
local new_x0 = x0 + max(tl, bl) | |
local new_y0 = y0 + max(tl, tr) | |
local new_x1 = x1 - max(tr, br) | |
local new_y1 = y1 - max(bl, br) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class EnemyModel | |
{ | |
public ReactiveProperty<long> CurrentHp { get; private set; } | |
public ReactiveProperty<bool> IsDed { get; private set; } | |
public EnemyModel(int initialHp) | |
{ | |
CurrentHp = new ReactiveProperty<long>(initialHp); | |
IsDead = CurrentHp.Select(x => x <= 0).ToReactiveProperty(); | |
} |