The canvas tag has no wiki summary.
3
votes
1answer
49 views
Collision detection accuracy
How do you guys think I can improve the code for collision detection on my website asteroidfield.eu5.org? The current code is
var dx = Math.abs(c1.getcx() - c2.getcx());
var dy = Math.abs(c1.getcy() ...
1
vote
1answer
48 views
Javascript canvas interactive chart - how to make my code shorter
I'm trying to teach myself javascript and HTML5, (just beginning), and for some practice with canvas I am trying to turn this chart into an interactive chart on canvas, whereby clicking on a word ...
0
votes
1answer
68 views
My second attempt at canvas spatial grid collision? Did I get it?
After posting my first question and my first attempt which you can see here,
My first attempt at canvas spatial grid collision? Please be honest!
I have re-written it to try and implement what the ...
3
votes
1answer
93 views
My first attempt at canvas spatial grid collision? Please be honest!
The code,
$(document).ready(function() {
window.addEventListener('keydown', keyPress, true); // event listener for keyboard presses
function keyPress(evt) {
if(engine.activeBlock) { // block is ...
3
votes
1answer
233 views
Javascript/Canvas Game Dev (pong)
This is the first time I've written javascript in this way (previously all I've done mostly is DOM manipulation and form validation in vanilla and jquery).
I've begun working on a basic pong game. ...
2
votes
0answers
71 views
JavaScript basic game code structure tips
I'm learning JavaScript and came up with this basic game code structure (using the CreateJS framework):
var stage;
var totalLoaded = 0;
var manifest;
var game = game || {};
game.init = {
...
5
votes
1answer
116 views
Optimize iterative pixel blending function
Summary
I've created a function that blends tiles on a 2D hexagonal grid with their neighboring tiles based on an image that serves as a "blend mask". It runs, and isn't too intensive, but I feel it ...
6
votes
2answers
240 views
Splitting text into lines from a max width value for CANVAS
Ok so this works as is, and is not actually slow at all (from what I can see) - However I don't like the taste of nested while loops and was wondering if anyone could give some insight on a different ...
