Can't get CoffeeScript mode to work.

I'm using Processing 2.2. I have already installed and uninstalled twice. :S

Tagged:

Answers

  • edited August 2014

    Does JavaScript Mode fail too? Can you at least run any CoffeeScript Mode's bundled examples?

  • Javascript seems to work fine. And no, I can't even run the examples in CoffeeScript Mode. :S

  • Does the CoffeeScript Mode show up for selection along the others?
    The other option is manually downloading it from the link below:
    https://github.com/fjenett/coffeescript-mode-processing/archive/master.zip

    • Open it and go to: "/coffeescript-mode-processing-master/release/" and open "CoffeeScriptMode.zip" file.
    • Find your "sketchbook" folder and enter its "/modes" subfolder.
    • Now you gotta unpack "CoffeeScriptMode.zip" into "sketchbook/modes/".
  • Yes, it's listed. It opens, but I don't see any buttons, and when I try to run a sketch (any sketch) it blows. That was on my Mac.

    I'm on my PC now and it's listed, it opens, I can run the examples, but the code has no color coding. :S And when I try to run the simplest sketch written by me I only get this in my browser:

    Parent Directory
    
    Sat Aug 23 18:38:49 CDT 2014
    

    I'm going to try to install it manually now, thanks.

  • edited August 2014 Answer ✓

    I can run the examples, but the code has no color coding.

    Unfortunately, coding color highlight wasn't implemented yet. It's all mono black! :-&
    Auto-format (CTRL+T) doesn't work either! :o3

    I'm on my PC now and it's listed, it opens, I can run the examples,...
    I'm going to try to install it manually now, thanks.

    If you successfully installed it in any system, you can simply copy 'n' paste that "/CoffeeScriptMode" subfolder to another "sketchbook/modes/"! B-)
    Just remember to close all instances & re-open Processing after that though! L-)

  • edited August 2014

    And when I try to run the simplest sketch written by me I only get this in my browser:

    Writing web apps is more difficult b/c it runs in a browser and we don't explicitly see "compile errors".
    Rather, we gotta open a browser's console in order to inspect for any lurking exceptions! :-B
    For Firefox family browsers, hit SHIFT + CTRL + J. And for Chromium's, hit SHIFT + CTRL + I. *-:)

    CoffeeScript & Python languages use indentation instead of curly braces in order to denote scope blocks.
    And "CoffeeScript Mode" is even more strict. We gotta choose how many spaces to use for it and stick to it!

    This example below uses a 4-space indentation:
    http://studio.processingtogether.com/sp/pad/export/ro.90WsCogc75rxf/latest

    ###
    * Pulsating Spiral Flower (v3.01.1)
    * by  Kevin (2014/Apr)
    * mod GoToLoop
    *
    * forum.processing.org/two/discussion/4266/
    * how-to-create-a-pulsating-particle-system-that-is-being-built
    *
    * studio.processingtogether.com/sp/pad/export/ro.90WsCogc75rxf/latest
    ###
    
    
    GAP = `020`; RAD = 3; EIGHTH_PI = Processing::QUARTER_PI/2.0
    ang = 0
    
    setup: ->
    
        size 500, 500, JAVA2D; frameRate 60; smooth 4
        do noStroke; ellipseMode CENTER
    
        ang = PI * (3 - sqrt 5)
    
    
    draw: ->
    
        background -1; translate width>>1, height>>1
        do circles
    
    
    circles = ->
    
        t = .1*THIRD_PI*frameCount; n = 3*frameCount
    
        while --n
    
            r = .25*GAP*sqrt n
            theta = n*ang
            pulse = 6 + RAD*sin t - n*EIGHTH_PI
    
            fill `0100`, map(r*2, 0, width, 0, `0400`), `0220`, `0200`
            ellipse r*cos(theta), r*sin(theta), pulse, pulse
    
    
        return
    

    While this 1 only 2 spaces:
    http://studio.processingtogether.com/sp/pad/export/ro.9o1T5z1ghf2s7/latest

    # Nature of Code - EXERCISE 1.3 - 3D Bouncing Ball
    # Extend the bouncing ball with vectors example into 3D. 
    # Can you get a sphere to bounce around a box?
    
    # forum.processing.org/one/topic/
    # the-nature-of-code-code-solutions-of-the-examples
    
    # studio.processingtogether.com/sp/pad/export/ro.9o1T5z1ghf2s7/latest
    
    BALL_DIM = 30; CUBE_DIM = 450; CUBE_RAD = CUBE_DIM >> 1
    
    cx = cy = 0
    location = velocity = null
    
    setup: ->
      size 400, 400, P3D; do noSmooth; strokeWeight 2
    
      cx = width >> 1; cy = height >> 1
      location = new PVector; velocity = new PVector 3, 2, 4
    
    draw: ->
      background -1
      do drawCube; do moveSphere; do drawSphere
    
    drawCube = ->
      #move cube and ball to center:
      translate cx, cy, -CUBE_DIM
    
      #rotate cube and ball so its 3D-ness can be appreciated:
      rotateX -QUARTER_PI; rotateY QUARTER_PI; rotateZ QUARTER_PI/2
    
      #draw cube:
      do noFill; stroke 0
      box CUBE_DIM
    
    moveSphere = ->
      #move ball:
      location.add velocity
    
      #detect edges with center at 0,0 and edge minus width of ball:
      velocity.x *= -1   if checkBounce location.x
      velocity.y *= -1   if checkBounce location.y
      velocity.z *= -1   if checkBounce location.z
    
    drawSphere = ->
      #draw ball and lights for definition:
      translate location.x, location.y, location.z
    
      fill `0300`; do noStroke; do lights
      sphere BALL_DIM
    
    checkBounce = (coord) ->
      coord < -CUBE_RAD + BALL_DIM | coord > CUBE_RAD - BALL_DIM
      #not (-CUBE_RAD + BALL_DIM < coord < CUBE_RAD - BALL_DIM)
    
Sign In or Register to comment.