From 3b14b2d5badb15bb2dbd4d58c72cfb1459b38cd2 Mon Sep 17 00:00:00 2001 From: Gordon Williams Date: Tue, 5 May 2020 13:42:27 +0100 Subject: [PATCH] Speed updates --- apps.json | 6 +++--- apps/astroid/ChangeLog | 1 + apps/astroid/asteroids.js | 1 + apps/flappy/ChangeLog | 1 + apps/flappy/app.js | 15 ++++++++------- apps/trex/ChangeLog | 1 + apps/trex/trex.js | 1 + 7 files changed, 16 insertions(+), 10 deletions(-) create mode 100644 apps/astroid/ChangeLog create mode 100644 apps/trex/ChangeLog diff --git a/apps.json b/apps.json index a1a8ad675..93003c429 100644 --- a/apps.json +++ b/apps.json @@ -206,7 +206,7 @@ { "id": "trex", "name": "T-Rex", "icon": "trex.png", - "version":"0.01", + "version":"0.02", "description": "T-Rex game in the style of Chrome's offline game", "tags": "game", "allow_emulator":true, @@ -218,7 +218,7 @@ { "id": "astroid", "name": "Asteroids!", "icon": "asteroids.png", - "version":"0.01", + "version":"0.02", "description": "Retro asteroids game", "tags": "game", "allow_emulator":true, @@ -780,7 +780,7 @@ { "id": "flappy", "name": "Flappy Bird", "icon": "app.png", - "version":"0.03", + "version":"0.04", "description": "A Flappy Bird game clone", "tags": "game", "allow_emulator":true, diff --git a/apps/astroid/ChangeLog b/apps/astroid/ChangeLog new file mode 100644 index 000000000..42c1df403 --- /dev/null +++ b/apps/astroid/ChangeLog @@ -0,0 +1 @@ +0.02: Add "ram" keyword to allow 2v06 Espruino builds to cache function that needs to be fast diff --git a/apps/astroid/asteroids.js b/apps/astroid/asteroids.js index cb44db904..da4dc017e 100644 --- a/apps/astroid/asteroids.js +++ b/apps/astroid/asteroids.js @@ -59,6 +59,7 @@ function gameStart() { function onFrame() { + "ram" var t = getTime(); var d = (lastFrame===undefined)?0:(t-lastFrame)*20; lastFrame = t; diff --git a/apps/flappy/ChangeLog b/apps/flappy/ChangeLog index 25c3827bd..62f107d11 100644 --- a/apps/flappy/ChangeLog +++ b/apps/flappy/ChangeLog @@ -1,2 +1,3 @@ 0.02: Tweaks to make flappy bird run with less RAM available 0.03: A few tweaks to improve rendering speed +0.04: Add "ram" keyword to allow 2v06 Espruino builds to cache function that needs to be fast diff --git a/apps/flappy/app.js b/apps/flappy/app.js index 4895b8530..9276010c0 100644 --- a/apps/flappy/app.js +++ b/apps/flappy/app.js @@ -32,10 +32,11 @@ function gameStop() { } function draw() { + "ram" var H = g.getHeight()-24; g.setColor("#71c6cf"); g.fillRect(0,0,g.getWidth(),H-1); - floorpos++; + floorpos++; for (var x=-(floorpos&15);xbbot)) gameStop(); }); diff --git a/apps/trex/ChangeLog b/apps/trex/ChangeLog new file mode 100644 index 000000000..42c1df403 --- /dev/null +++ b/apps/trex/ChangeLog @@ -0,0 +1 @@ +0.02: Add "ram" keyword to allow 2v06 Espruino builds to cache function that needs to be fast diff --git a/apps/trex/trex.js b/apps/trex/trex.js index 92c5d049c..fe84cb31a 100644 --- a/apps/trex/trex.js +++ b/apps/trex/trex.js @@ -165,6 +165,7 @@ function gameStop() { } function onFrame() { + "ram" g.clear(); if (rex.alive) { frame++;