diff options
| author | Gubolin <gubolin@fantasymail.de> | 2014-09-07 12:34:55 +0200 |
|---|---|---|
| committer | Code WvS <code-wvs@quantentunnel.de> | 2015-03-21 11:41:15 +0100 |
| commit | dbc463c70ad7bbd43b907ec0345bd0965698c0cf (patch) | |
| tree | 69b1dbfd8777072c77dbd292b06a51af0d44a5d9 /objects.js | |
| parent | 970bb151505e9ad7c71f518d9a4da2ab1f207acc (diff) | |
| download | snap-yow-dbc463c70ad7bbd43b907ec0345bd0965698c0cf.tar.gz snap-yow-dbc463c70ad7bbd43b907ec0345bd0965698c0cf.zip | |
cherry-pick compass and acceleration blocks
Diffstat (limited to 'objects.js')
| -rw-r--r-- | objects.js | 34 |
1 files changed, 34 insertions, 0 deletions
@@ -934,6 +934,26 @@ SpriteMorph.prototype.initBlocks = function () { category: 'sensing', spec: 'vibrate %n seconds' }, + reportCompassHeading: { + type: 'reporter', + category: 'sensing', + spec: 'current compass heading' + }, + reportAccelerationX: { + type: 'reporter', + category: 'sensing', + spec: 'current acceleration along the x axes' + }, + reportAccelerationY: { + type: 'reporter', + category: 'sensing', + spec: 'current acceleration along the y axes' + }, + reportAccelerationZ: { + type: 'reporter', + category: 'sensing', + spec: 'current acceleration along the z axes' + }, // Operators reifyScript: { @@ -2042,6 +2062,12 @@ SpriteMorph.prototype.blockTemplates = function (category) { blocks.push('-'); blocks.push(block('doVibrate')); blocks.push('-'); + blocks.push(block('reportCompassHeading')); + blocks.push('-'); + blocks.push(block('reportAccelerationX')); + blocks.push(block('reportAccelerationY')); + blocks.push(block('reportAccelerationZ')); + blocks.push('-'); blocks.push(block('overpassQuery')); // for debugging: /////////////// @@ -4538,6 +4564,8 @@ StageMorph.prototype.init = function (globals) { this.paletteCache = {}; // not to be serialized (!) this.lastAnswer = ''; // last user input, do not persist this.activeSounds = []; // do not persist + this.acceleration = null; // do not persist + this.compassHeading = null; // do not persist this.trailsCanvas = null; this.isThreadSafe = false; @@ -5306,6 +5334,12 @@ StageMorph.prototype.blockTemplates = function (category) { blocks.push(block('reportDate')); blocks.push('-'); blocks.push(block('doVibrate')); + blocks.push('-'); + blocks.push(block('reportCompassHeading')); + blocks.push('-'); + blocks.push(block('reportAccelerationX')); + blocks.push(block('reportAccelerationY')); + blocks.push(block('reportAccelerationZ')); // for debugging: /////////////// |
