TPT in HTML (Concept)

  • china-richway2
    19th Feb 2015 Member 8 Permalink

    I just had a really cool idea. I would like to put TPT on an HTML page so people can play TPT without downloading it. It takes a lot of time to re-write all TPT code into Javascript and I thought that I cannot have it done myself. So here is the concept.

    http://s-168071.gotocdn.com/tpt/tpt.htm

     

    The latest version: https://github.com/china-richway2/TPT-HTML

    I'm very sorry because the winter holiday has ended and I may not be able to code anymore. However, I'll still be active and if you want to code, feel free to send pull requests!

    Edited 3 times by china-richway2. Last: 25th Feb 2015
  • boxmein
    19th Feb 2015 Former Staff 3 Permalink
    First suggestion: don't console.log all the time!
    Second suggestion: don't use
    setTimeout(f, 0)
    as a tick function, instead use
    requestAnimationFrame(f)

    Third: you don't need eval() to address properties of a function: the line
    eval("tpt.Element."+ele.name+'=v');
    could be replaced with
    tpt.Element[ele.name] = v
    .

    Other than that, keep going! :D
  • china-richway2
    19th Feb 2015 Member 1 Permalink

    @boxmein

    Thank you for your awesome suggestions! Actually I just wanted someone to code with me together because it's going to take forever.

    Edit: I'm very busy

     

    Edit: I just had a problem: Where can I find TPT icons (those things on the right and at the bottom)? I couldn't find it in the source code.

    Edited 2 times by china-richway2. Last: 19th Feb 2015
  • Schicko
    19th Feb 2015 Member 0 Permalink

    @china-richway2 (View Post)

     

    Have a look at this, maybe it would help: http://tpt.io/.259045

    So far, it looks very promising, keep it up! ^_^

  • 2015
    19th Feb 2015 Member 0 Permalink

    This looks like a really cool idea. I wounder how it is going to work

  • Kikkin
    20th Feb 2015 Banned 0 Permalink
    This post is hidden because the user is banned
  • china-richway2
    20th Feb 2015 Member 2 Permalink

    @Schicko (View Post)

     That is exactly what I am doing, but I couldn't find the source now. You see, the @Lockheedmartin's page is 404, the github page is also 404.

     

    The problem I'm facing is where to get the icons (those things on TPT's right). I couldn't find it in TPT's 2.12MB of source code.

  • boxmein
    20th Feb 2015 Former Staff 0 Permalink
    @china-richway2 (View Post)
    Good news: the icons are here!
    Bad news: you have to decode it somehow similar to this.
  • china-richway2
    20th Feb 2015 Member 1 Permalink

    @boxmein (View Post)

     Decoded successfully, now I can display it in my TPT window. Thank you.

  • Lord_Bowserinator
    20th Feb 2015 Member 1 Permalink

    Nice, but when drawing you might want to draw a line between the previous mouse location and the current so when you move your mouse super fast it doesn't just draw circles that aren't connected. Also remember to add the abilty to show your mouse cursor size (on the screen as an outline of the shape).