I'm building a JavaScript game and I want to alert after all images are loaded. I tried this code but it's not working:  function loadEveryThing() {   var imgNumber = 0;    img1 = new Image();   img1.src = "1.png"   img1.onload = func...
I'm trying to learn object oriented programming in javascript so I try to make a simple game. I would like to make a character that moves. There is the code in js:    function move(event)     { var k=event.keyCode;   var chr = {      updown : fun...
In the Below code link HTML5 canvas spin wheel game. I want to stop this canvas at a user-defined position as if the user wants to stop always at 200 texts or 100 texts like that.   Currently, it is stopping at random points I want to control where t...
I'm trying to rewrite my canvas-based rendering for my 2d game engine. I've made good progress and can render textures to the webgl context fine, complete with scaling, rotation and blending. But my performance sucks. On my test laptop, I can...
I'm working on a 2D game in Node where the character needs to move diagonally. This is a top-down, text-based game purely in a Node environment (no browser, so I don't have nice keydown/keyup events at my disposal).  I'm using the keypres...
You may have played Snake, a game where you have to eat food to grow and you fail if you collide with the snake's body or certain obstacles. The first part was easy, but the latter seems impossible to achieve.  I have tried to make a for loop che...
I've written a loop in JavaScript that will render rings of concentric hexagons around a central hexagon on the HTML canvas.   I start with the innermost ring, draw the hex at 3 o'clock, then continue around in a circle until all hexes are re...
If you close-vote or down-vote the question please comment why. I'm willing to change it, but I can only do this if you tell me what is wrong.  I'm currently trying to implement the player movement for a bomberman-like game that I'm writi...
So i have been working hard at a game using HTML5 and JavaScript. I am trying to make a space invaders styled game and as a result i have an array of enemies. I have separate functions dedicated to creating the array of enemies, drawing them to scree...
I don't understand authors login when calculating collisions between two circles (bubbles). Here is the Calculating collisions section.  Author writes:     The bubble being fired follows a set of coordinates defined by the   equations:      px =...

Tags

Recent Questions

Top Questions

Home Tags Terms of Service Privacy Policy DMCA Contact Us

©2020 All rights reserved.