diff options
| author | Gubolin <gubolin@fantasymail.de> | 2014-09-07 12:34:55 +0200 |
|---|---|---|
| committer | Gubolin <gubolin@fantasymail.de> | 2014-09-07 12:34:55 +0200 |
| commit | 3c71f1a3871926a614eaefac079e79e0d9b95395 (patch) | |
| tree | edca6c9d9155b4dac8600178bcb068f6d43b5fa8 /objects.js | |
| parent | d44f44e68db067f802a75d7a8a0906d5d2d96c8c (diff) | |
| download | snap-3c71f1a3871926a614eaefac079e79e0d9b95395.tar.gz snap-3c71f1a3871926a614eaefac079e79e0d9b95395.zip | |
add compass heading and acceleration blocks
Diffstat (limited to 'objects.js')
| -rw-r--r-- | objects.js | 34 |
1 files changed, 34 insertions, 0 deletions
@@ -883,6 +883,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: { @@ -1889,6 +1909,12 @@ SpriteMorph.prototype.blockTemplates = function (category) { blocks.push(block('doSetFastTracking')); blocks.push('-'); blocks.push(block('reportDate')); + blocks.push('-'); + blocks.push(block('reportCompassHeading')); + blocks.push('-'); + blocks.push(block('reportAccelerationX')); + blocks.push(block('reportAccelerationY')); + blocks.push(block('reportAccelerationZ')); // for debugging: /////////////// @@ -4263,6 +4289,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; @@ -4998,6 +5026,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: /////////////// |
