History

got rid of tabs

Burt Sloane committed 9 years ago

Commit 4f7a1a61 parent c35020e6 files · +175 −162Browse files

Showing the changes to scripts/tutorials/entity_scripts (1 of 6 files). Show all

Unified · Split

scripts/tutorials/entity_scripts/midiSphere.js+21−21
@@ -15,35 +15,35 @@ · 14 unmodified lines
1515
1616 function MidiSphere() {
1717 _this = this;
18− this.clicked = false;
19− return;
18+ this.clicked = false;
19+ return;
2020 }
21−
21+
2222 MidiSphere.prototype = {
2323 preload: function(entityID) {
2424 this.entityID = entityID;
25− Midi.midiNote.connect(function(eventData) {
26− print("MidiSphere.noteReceived: "+JSON.stringify(eventData));
27− Entities.editEntity(entityID, { color: { red: 2*eventData.note, green: 2*eventData.note, blue: 2*eventData.note} });
28− });
29− print("MidiSphere.preload");
25+ Midi.midiNote.connect(function(eventData) {
26+ print("MidiSphere.noteReceived: "+JSON.stringify(eventData));
27+ Entities.editEntity(entityID, { color: { red: 2*eventData.note, green: 2*eventData.note, blue: 2*eventData.note} });
28+ });
29+ print("MidiSphere.preload");
3030 },
3131 unload: function(entityID) {
32− print("MidiSphere.unload");
32+ print("MidiSphere.unload");
3333 },
3434
35− clickDownOnEntity: function(entityID, mouseEvent) {
36− print("MidiSphere.clickDownOnEntity");
37− if (this.clicked) {
38− Entities.editEntity(entityID, { color: { red: 0, green: 255, blue: 255} });
39− this.clicked = false;
40− Midi.playMidiNote(144, 64, 0);
41− } else {
42− Entities.editEntity(entityID, { color: { red: 255, green: 255, blue: 0} });
43− this.clicked = true;
44− Midi.playMidiNote(144, 64, 100);
45− }
46− }
35+ clickDownOnEntity: function(entityID, mouseEvent) {
36+ print("MidiSphere.clickDownOnEntity");
37+ if (this.clicked) {
38+ Entities.editEntity(entityID, { color: { red: 0, green: 255, blue: 255} });
39+ this.clicked = false;
40+ Midi.playMidiNote(144, 64, 0);
41+ } else {
42+ Entities.editEntity(entityID, { color: { red: 255, green: 255, blue: 0} });
43+ this.clicked = true;
44+ Midi.playMidiNote(144, 64, 100);
45+ }
46+ }
4747
4848 };
4949