Tagged Questions
1
vote
0answers
46 views
JS - JQuery need tips
I am learning js/jquery and I am trying to make a little game. I made a small "engine" for it.
I was wondering, if you could tell me, if I am doing something wrong/uneffective or something.
Any ...
2
votes
1answer
39 views
Review a simple sprite sheet animation script
This is just a simple script for testing sprite sheet animations. I'm trying to improve my code style, so I'm curious about suggestions anyone might have about best practices or readability.
...
3
votes
1answer
55 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() ...
2
votes
2answers
71 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
72 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
98 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
280 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
78 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
124 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
246 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 ...