gabrielflorit / livecoding

livecoding
http://gabrielflorit.github.io/livecoding/
MIT License
176 stars 28 forks source link

support for game engine #21

Closed gabrielflorit closed 12 years ago

gabrielflorit commented 12 years ago

from tansaku:

Do you think it would be practical to build a little game thing like the one in Brett Victor's talk based on your framework? I've been posting to a few JavaScript fora to explore the possibilities. One person at craftyjs http://craftyjs.com/ came back to me saying "this could work but the editor does not allow to include libs. if there were a button or stuff where i can add crafty+jquery then we could test it;) maybe you can clone his repo and add this feature?"

https://groups.google.com/forum/#!topic/craftyjs/ZrA0tJzRQpQ

Maybe we need to ask the ace9 editor folks syntax for pulling in javascript libraries? Or is there some import syntax for javascript that can just get evaled ...?

tansaku commented 12 years ago

I was looking at javacscript import and export statements, but that doesn't look like quite the right thing:

http://w3resource.com/javascript/statements/import.php

Here's the craftyjs library:

http://heanet.dl.sourceforge.net/project/learningprocess/crafty-min.js

which would usually be pulled in by a statement like this:

<script type="text/javascript" src="assets/crafty-min.js"></script>

or something.

I guess the immediate question for me is how are you pulling in the d3 library? I see you have some js libraries pulled in at the bottom of the page:

what would be cool would be having a separate "library" tab like you now have a separate tab for "css" and in that library tab you could just put a list of js libraries that should also be pulled into the page ...?

CHEERS> SAM

gabrielflorit commented 12 years ago

Loading external libraries is easy - see this: http://livecoding.gabrielflor.it/3098870

Also reproduced here:

var url = 'http://cdn.craftycomponents.com/crafty-release.js';

// only retrieve above script once
$.ajaxSetup({
    cache: true
});

$.getScript(url, function(a, b, c) {

    // your game code here

});
tansaku commented 12 years ago

very cool!

can I share that with the crafty folks, or is that new interface still under wraps?

Many thanks in advance CHEERS> SAM

On 7/12/12 4:30 PM, Gabriel Florit wrote:

Loading external libraries is easy - see this: http://livecoding.gabrielflor.it/3098870

Also reproduced here:

 var url = 'http://cdn.craftycomponents.com/crafty-release.js';

 // only retrieve above script once
 $.ajaxSetup({
  cache: true
 });

 $.getScript(url, function(a, b, c) {

      // your game code here

 });

Reply to this email directly or view it on GitHub: https://github.com/gabrielflorit/livecoding/issues/21#issuecomment-6938373

Sam's Technical Blog http://linklens.blogspot.com

gabrielflorit commented 12 years ago

Definitely - livecoding is now public. Share away!