loop() not implemented in coffeescript mode?
in
Processing with Other Languages
•
5 months ago
hey all.
i was creating a simple on/off switch as i often do when debugging, println-ing lots of stuff etc.
in processing, that looks like this, and it works as i'd expect it to:
- boolean onOff = true;
- int i = 0;
- void setup(){
- }
- void draw(){
- println(i);
- i++;
- }
- void keyPressed(){
- if(onOff){
- println("turning off");
- noLoop();
- } else if(!onOff) {
- loop();
- println("turning on");
- }
- onOff = !onOff;
- }
The equivalent coffeeScript version in CS mode will not even run. When I comment out loop(), it works just fine. Can anyone confirm?
- onOff = true
- i = 0;
- setup: ->
- size 200, 200
- draw: ->
- println i
- i++
- keyPressed: ->
- if onOff
- println "turning off"
- noLoop()
- if not onOff
- println "turning on"
- loop()
- onOff = !onOff
1