Added star example
This commit is contained in:
@@ -33,6 +33,7 @@ function Commander (ronin) {
|
||||
|
||||
this.run = (txt = this._input.value) => {
|
||||
if (txt.indexOf('$') > -1) { ronin.log('Present: $'); return }
|
||||
ronin.surface.maximize()
|
||||
ronin.interpreter.run(txt)
|
||||
ronin.always === true && requestAnimationFrame(() => this.run(txt))
|
||||
}
|
||||
|
||||
@@ -31,8 +31,8 @@ function Library (ronin) {
|
||||
return { x, y, w, h, t }
|
||||
}
|
||||
|
||||
this.circle = (x, y, r, t = 'circle') => { // Returns a circle shape.
|
||||
return { x, y, r, t }
|
||||
this.circle = (cx, cy, r, t = 'circle') => { // Returns a circle shape.
|
||||
return { cx, cy, r, t }
|
||||
}
|
||||
|
||||
this.line = (a, b, t = 'line') => { // Returns a line shape.
|
||||
@@ -345,6 +345,11 @@ function Library (ronin) {
|
||||
return args
|
||||
}
|
||||
|
||||
this.table = (arg) => {
|
||||
console.table(arg)
|
||||
return arg
|
||||
}
|
||||
|
||||
this.time = (rate = 1) => { // Returns timestamp in milliseconds.
|
||||
return (Date.now() * rate)
|
||||
}
|
||||
|
||||
@@ -100,7 +100,7 @@ function Surface (ronin) {
|
||||
}
|
||||
|
||||
this.traceCircle = function (circle, context) {
|
||||
context.arc(circle.x, circle.y, circle.r, 0, 2 * Math.PI)
|
||||
context.arc(circle.cx, circle.cy, circle.r, 0, 2 * Math.PI)
|
||||
}
|
||||
|
||||
this.traceText = function (text, context) {
|
||||
|
||||
Reference in New Issue
Block a user