sry 4 dblpost but (Translation: Sorry for the double-post but...)
midnightleopard wrote:
...
It looked like this:Code:
setInterval(function(){ clear(); draw(); drive(); }, 15);
Oh yayayayayayayay! It works!
Offline
scratchisthebest wrote:
Well, there isn't a magic button to make a project into HTML5. You'll need to get your hands dirty in Canvas.
==Scratch to HTML5 Mini-Tutorial==
1. Go to the library and find a good JS Canvas book.
2. Use the tools presented in the book to make a copy of a Scratch project.
3. Share.
4. Profit!!!111!!1!
==End of Mini-Tutorial==
There aren't books about canvas yet because it is still in developement.
Offline
midnightleopard wrote:
I guess one question still remains...
http://textspace.net/img/1322776553_002 … 776553.gif
MEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE!!!!!
Offline
The most I can see from the project is that you coded everything in JS and made the screen with a variable called canvas. And the HTML5 element canvas.
Pretty cool.
Last edited by Magnie (2011-12-01 17:19:50)
Offline
midnightleopard wrote:
I guess one question still remains...
http://textspace.net/img/1322776553_002 … 776553.gif
IIIIIIIII DDDDDDDOOOOOOOOOOOO!!!!!!!!!!!!!!!!!!!
Offline
Magnie wrote:
The most I can see from the project is that you coded everything in JS and made the screen with a variable called canvas. And the HTML5 element canvas.
Pretty cool.
Canvas is actually a HTML tag, though you're correct in a certain sense, because you do have to set a variable to the tag (i.e. document.getElementById("CanvasId") )
Last edited by MoreGamesNow (2011-12-01 22:52:34)
Offline
MoreGamesNow wrote:
Magnie wrote:
The most I can see from the project is that you coded everything in JS and made the screen with a variable called canvas. And the HTML5 element canvas.
Pretty cool.Canvas is actually a HTML tag, though you're correct in a certain sense, because you do have to set a variable to the tag (i.e. document.getElementById("CanvasId") )
HTML "tag" and "element" are the same thing.
Offline
Of course, you could document.write or body.innerHTML+= it and have almost NO html (except for the import statement).
Offline
midnightleopard wrote:
scratchisthebest wrote:
Well, there isn't a magic button to make a project into HTML5. You'll need to get your hands dirty in Canvas.
==Scratch to HTML5 Mini-Tutorial==
1. Go to the library and find a good JS Canvas book.
2. Use the tools presented in the book to make a copy of a Scratch project.
3. Share.
4. Profit!!!111!!1!
==End of Mini-Tutorial==There aren't books about canvas yet because it is still in developement.
Then why do I have one?
It's called Foundation HTML5 Canvas for Games and Entertainment. I like it.
Offline
scratchisthebest wrote:
midnightleopard wrote:
scratchisthebest wrote:
Well, there isn't a magic button to make a project into HTML5. You'll need to get your hands dirty in Canvas.
==Scratch to HTML5 Mini-Tutorial==
1. Go to the library and find a good JS Canvas book.
2. Use the tools presented in the book to make a copy of a Scratch project.
3. Share.
4. Profit!!!111!!1!
==End of Mini-Tutorial==There aren't books about canvas yet because it is still in developement.
Then why do I have one?
It's called Foundation HTML5 Canvas for Games and Entertainment. I like it.
woa.
I taught myself canvas but I've got to get that.
Offline
Magnie wrote:
HTML "tag" and "element" are the same thing.
Tag usually refers to a <>'d piece of the source code, like '<p class="important">'.
Element usually refers to a node in the DOM that represents a tag.
So in this case, the '<canvas...>' is a tag, and the corresponding element is retrieved in the script using the getElementById method.
Offline
To expand to those of you who want to know (sorry midnightleopard for stealing your thunder ), you have make a canvas element, give it an "id", and then you can use JavaScript to draw on the canvas. Here is some sample code (you have a Canvas Tag with the id of "cvs")
var c_cvs = document.getElementById("cvs"); // basically sets c_cvs to the canvas tag var context = c_cvs.getContext("2d"); // you'll use this to draw to the canvas context.fillRect(10,10,30,50); /* the above script makes a rectangle, with one corner at the coordinates 10,10, and the coordinates of the second corner at (10+30),(10+50). It is basically context.fillRect(x,y,width,height) */
Of course, there are tons of different keywords to learn. You can draw lines, past images, draw arcs, text, and many other cool things!
Last edited by MoreGamesNow (2011-12-02 23:02:13)
Offline
MathWizz wrote:
@MoreGamesNow you forgot that the canvas id is 'poop'.
I knew I forgot something!
Offline
cocolover76 wrote:
You should switch to SVG, that way you don't have to use a separate element for the score.
There are books on SVG.
Thick ones.
There's even more support for SVG than Canvas.
Offline
MathWizz wrote:
And the reason you can't have text on a canvas is...?
WRONG!!!!!1!11!111
sorry... I had to do that.
var poopy = document.getElementById("poop"); var pen = poopy.getContext("2d"); var text = "Hello canvassssssssy"; var x = 40; var y = 40; pen.fillText(text, x, y);
Offline
MathWizz wrote:
It was a question. -.-
oh. :::)
Offline
Cool!
Offline
Actually, you CAN have text in canvas and I knew that. I was just being lazy. Also there are compatibility issues with text in canvas, but there are work arounds.
I have seen SVG, but I love canvas to much to learn another.
Offline
Good job with making the port! Also I created a website just for HTML5 canvas games: www.html5gamer.weebly.com
Also stick with canvas because SVG doesn'tn support good fast drawing. I am currently trying to make a .exe file to convert .sb to HTML5.
Offline
Necropost ^^
I don't remember if I have seen this before, but it would be awesome if someone wrote a JS library that uses Scratch-like commands!
Offline
nathanprocks wrote:
Necropost ^^
I don't remember if I have seen this before, but it would be awesome if someone wrote a JS library that uses Scratch-like commands!
Good idea, I am going to make that JS library!
Offline