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...
I'm currently writing a little HTML5 canvas/JS based snake clone similar to the classic Nokia Snake. (This is my first HTML5 canvas/JS game as well as my first game, I'm still a novice programmer ;) )  To keep things simple I decided to make...
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...
So, I am currently reinventing the wheel (and learning a lot) by trying my hand at making a simple physics engine for my game engine. I have been searching the internet, trying (and failing) to fix my current problem. There are a lot of resources out...
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...
I am working on a shooter game and I have a problem with bullets position (now are centered). How to change bullets position like on this image (+rotation): .  My example (https://jsfiddle.net/60kvpx7s/, controls: mouse, left button to shoot):    var...
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...

Tags

Recent Questions

Top Questions

Home Tags Terms of Service Privacy Policy DMCA Contact Us

©2020 All rights reserved.