TPT in Javascript using Processing.js

  • mrsalit0s
    22nd Nov 2013 Member 0 Permalink

    I had the idea a few weeks ago and started creating a PowderToy clon in HTML5 Canvas with Javascript using processingjs. For those who want to play around or just want to take a look at this small project can do it here: http://tptapi.com/TPTJS/TPTjs.html (Thank to Lockheedmartin for uploading!)

     

    Features:

    • GOL Element
    • Sand Element
    • PowderToy like UI
    • Play/Pause
    • Bruh size [+] / [-] ( not working as it should )

     

    note that TPTjs is optimized for firefox!

     

    screenshots: http://i.imgur.com/KrwvmC1.png  http://i.imgur.com/H08vavo.png

     

    source: https://github.com/MrSalit0s/TPTjs


    feedback is still welcome :)

     

    Edited 10 times by mrsalit0s. Last: 12th Mar 2014
  • boxmein
    22nd Nov 2013 Former Staff 0 Permalink
    > but after getting first results I noticed that javascript is pretty slow to realize a PowderToy clon.
    :O no way!

    Other than that good job on the implementation. Lots of constants in there (as is proper of a quick & dirty approach however not so much of something you want to keep on maintaining and developing!) and hard-coding which you would be better off to avoid.
    Edited 3 times by boxmein. Last: 22nd Nov 2013
  • mrsalit0s
    22nd Nov 2013 Member 0 Permalink

    > :O no way!


    haha :P

     

    > Lots of constants in there and hard-coding which you would be better off to avoid.

     

    yes but i'm not a pro at coding at all.. this was just made quick and dirty, but I'll remember that for future projects

  • boxmein
    22nd Nov 2013 Former Staff 0 Permalink
    Also since Processing is basically Java (although it's not meant to be a Java library !) you could use all sorts of object-oriented Java things for various element classes.
  • mniip
    22nd Nov 2013 Developer 1 Permalink
    > Lots of constants in there (as is proper of a quick & dirty approach however not so much of something you want to keep on maintaining and developing!) and hard-coding which you would be better off to avoid.

    > I'll remember that for future projects

    c'mon... when i say something like that my posts get hidden and i'm being hated by Feynman
  • jacob1
    22nd Nov 2013 Developer 0 Permalink
    @mniip (View Post)
    his was more positive, yours are just "this sucks because it has a global variable" and stuff like that. Also you continue on once he replies, boxmein just pointed something out once to actually help and stopped there.
  • Sylvi
    22nd Nov 2013 Moderator 2 Permalink

    I could work on making it faster, but I have TPTAPI to work on. Though for anyone who wants to try it out you may go here:

    http://tptapi.com/TPTJS/TPTjs.html

  • mrsalit0s
    23rd Nov 2013 Member 0 Permalink

    > Also since Processing is basically Java (although it's not meant to be a Java library !) you could use all sorts of object-oriented Java things for various element classes.

     

    interesting, i'll have a look at that.

     

    > Though for anyone who wants to try it out you may go here: http://tptapi.com/TPTJS/TPTjs.html

     

    Thank you for uploading this. unfortunately i hadn't the possibility to do it myself. added the link in my first post.

  • boxmein
    23rd Nov 2013 Former Staff 0 Permalink
    You could also check out a very-very-old project of mine which was related to that as well (Also Processing by the way, but written in more Java-ish Processing in the sense that I didn't use the Processing IDE nor do I have a .pde)

    http://github.com/boxmein/PixPlay
    Also check out this:
    https://gist.github.com/boxmein/7618661
    Edited once by boxmein. Last: 23rd Nov 2013