A new feature of HTML5, allowing Javascript apps to have a drawing surface in the browser.

learn more… | top users | synonyms

0
votes
2answers
32 views

Object have the same “speed” all time JavaScript

I try to create a 2D game with a big map and multiple objects. The player is always in the middle of the screen and all the other objects is moving around so it feels like a big map. I want the ...
2
votes
1answer
26 views

Dealing With Multiple requestAnimationFrame Calls

I am having issues with requestAnimationFrame calls stacking on top of each other. I am developing a platformer game, which has three separate functions that need animating (main menu, cutscene, in ...
2
votes
0answers
26 views

FillRecatangle set Opacity?

I have a game with "hud" which is drawn by fillrectangle. How would I fade these fillrectangles when the player is on the "hud"?
0
votes
0answers
69 views

How to maximum height and body to move in projectile motion( on Canvas)

**Really.anybody Know't this question's Answer? ** I asked this question before, but I think I worded it badly and thus did not get any response. I am trying to use an projectile motion in my game. ...
0
votes
1answer
53 views

canvas screen space camera rotation issue

I have a canvas on a camera set to it's screen space (not as a child of the camera) I have my camera rotate on the y and x axises but whenever I move it on the x axis (up and down) the canvas doesn't ...
1
vote
3answers
100 views

Limit access to socket end point

I'm developing a multiplayer canvas game based on socket.io and box2d physics engine. Is there a way to limit connections to my socket endpoint and only allow connections from a specific domain? ...
0
votes
0answers
37 views

Detecting collision of multiple moving objects

I have wrote a simple game that has a 100 balls bouncing off the borders of the canvas. Each ball is an instance of ball class function that has the following definition: var cnv = document....
1
vote
1answer
36 views

World Space canvas rendering in front of line mesh

I'm attempting to attach a pointer to my steamvr controller to simplify world interactions. I'm very new to unity, but found a nice volumetric line asset (VolumetricLines) that aesthetically is ...
0
votes
1answer
43 views

js canvas tiled map - for loop, while, or matrix

I am making a top-down view tiled map in canvas, where player is always in the middle of the screen, and map scrolls depending on where you go, like in moba games. I also want it to loop infinitely in ...
-1
votes
1answer
69 views

How to fill a canvas with triangles that are seemingly random?

Given a canvas say, 1000 X 1000 unit. I would like to fill the canvas with triangles. The triangles can be of any type right angle, equilateral...etc. To avoid big chunks of triangles lets say all ...
1
vote
1answer
55 views

Simulating elastic ball collisions quickly escalates to disaster

I'm trying to learn HTML canvas and was working on a basic physical simulation, where a number of balls are drawn and set in motion, and the program simulates them colliding and bouncing off the walls ...
1
vote
0answers
78 views

Pixel by pixel collision detection pinball

I'm currently working on a Pinball game using the HTML5 Canvas and JavaScript. Right now I'm getting a hard time with the pixel by pixel collision, which is fundamental because of the flippers. Right ...
3
votes
1answer
63 views

SDD Inverse Kinematics with constraints

I have a question regarding my quest on onderstanding IK solvers. After viewing this movie on YouTube: https://www.youtube.com/watch?v=MvuO9ZHGr6k I started recreating it with JavaScript. Just 2d on ...
1
vote
2answers
58 views

Cannot overlay text?

I'm trying to make text have a fixed position in world space and be overlayed in screen space at the same time. I have text in canvas with "Screen Space - Overlay" which covers my text located in ...
1
vote
2answers
99 views

Canvas slowly degrades in performance after a while

I was creating a simple game and was shocked to see how the performance started to degrade. It never happened to me before, most probably because I use images and not the context drawings. So I used ...
1
vote
0answers
33 views

How to fix my physics functions so they perform at the same speed across different FPS's

My jump function looks like - self.jump = function(){ //do the initial jump if (self.pressingUp && self.onGround) { //this just gets it off the ...
1
vote
1answer
80 views

Fastest way to render isometric world with moving entities?

I've got an isometric diamond-shaped world. The world consists of isometric planes like rooms. The walls and floors of the rooms and all obstacles and items in the rooms are isometric entities. So I ...
0
votes
1answer
26 views

Canvas/Paint Mechanic

I am currently working on an idea for a unity game app with a canvas mechanic. I understand I may have to use particles for the brush/paint f/x however I can not think of a way to add collision ...
0
votes
0answers
11 views

Clicking an entity with transformation

I am trying to understand how best to implement a click detection function in a 2d JavaScript game. I can demonstrate using a simple example of two square 'entities' which can be selected when ...
0
votes
1answer
57 views

Unity3d multiplayer canvas

so I am making multiplayer game and I stuck on one thing, I have blood overlay canvas in my scene(you know, in fps games if somebody shoots you your screen becomes red and this stuff), and when I ...
0
votes
2answers
96 views

How to improve my graphics on HTML5 canvas?

I am making my own army fighting simulator. Designer have made an 3D model with Blender and textured it, made animations. I have made sprites from that model and did programming. But the result is not ...
0
votes
0answers
14 views

Move ball through a direction angle in android canvas [duplicate]

I am building a simple game in android. I am successful in first step where I draw a ball in canvas in touch point. Now I am trying to move it from an initial point A (center) through the touch point ...
1
vote
2answers
45 views

Updating code to include states

The Problem I am having a problem in that I am finding it hard to understand how to update my current code so that it uses states. I am creating a game, the game has a menu, each page in the game ...
0
votes
0answers
48 views

Chrome Canvas bug on Mac OS X when switching spaces?

I have a simple Breakout clone created using the <canvas> element and the 2d context. Whilst playing the game in Google Chrome (version: 49.0.2623.87 (64-bit)) if I switch spaces within Mac OS ...
0
votes
2answers
227 views

How can I move an object around a canvas in a random direction at random times?

I am currently trying to move an object (circle ball) around the canvas in a random direction. I have already written the code for the wall collisions so the ball bounces back into canvas when the ...
1
vote
1answer
91 views

How should I efficiently clear and redraw my canvas with lots of animated sprites?

My current solution is to clear the entire canvas and redraw all sprites on every requestFrame(). This works but feels inefficient: I only need to clear the part of the canvas made invalid by ...
0
votes
1answer
15 views

Mousedown event not performing drawImage

I've been working on the basic gameplay. I'm to a point where I think it should draw a card in the quadrant clicked/tapped, but nothing is happening. I can't see what's wrong. Please help. My only ...
0
votes
1answer
46 views

Why are my canvas drawings larger than the actual image?

For the following page source, I've finally gotten a grip on rendering the cards. I'm puzzled why they appear about 2.5x larger on the canvas. <html> <head> <style> ...
0
votes
1answer
46 views

How to display a lot of small objects using WebGL?

Introduction The game scene contains a lot of 10x10 pixel elements: for 1980x1200 px. screen the number of elements on the scene can vary from 0 to 23760 (elements cannot intersect). The live ...
0
votes
1answer
32 views

HTML Canvas Makes Everything Bolder On Right Side

For some strange and sudden reason, my canvas seems to make lines thicker and darker on the right ~1/4-ish. I have tried multiple browsers and different computers and they all have the same rendering ...
1
vote
1answer
35 views

how to follow(center) a box inside canvas element

If inside a canvas I draw a box, and the I add arrows to move it, the box will eventually be out of my reach since it goes out the border and I cant see it. How could I follow the box so that it is ...
4
votes
1answer
118 views

Fixed Time Step Flutter

I've seen a lot of questions about this problem, but really no solution. Hopefully I can explain the issue well enough that I can get some sort of closure on this problem. I'm using a Fixed Time ...
0
votes
0answers
88 views

Using canvas graphics instead of traditional sprites in phaser

I'm trying to learn Phaser (total beginner with mild JS experience) and I'm following tutorials and such where everything is using sprites. I'm trying to get by with basic canvas shapes instead of ...
0
votes
0answers
82 views

How to get the angle an object is travelling at

I'm trying to figure out how to get the angle an object is moving at, but have ran into a few problems. My player object is moved by rotating the entity left and right by using the left and right ...
3
votes
0answers
71 views

Check if a point is touching a user drawn curve in HTML5 canvas

I am having trouble detecting whether a ball is colliding with a red curve. The curve below is an example of what a user may draw on to the canvas. I can't think of any fast ways to detect collision ...
1
vote
0answers
83 views

Drawing a hexgrid on a canvas, yet making it zoom/scrollable?

I'm developing a game in JS / PHP. The game is basically a 2D plane (hexgrid) where each hex represents a location in space. In total, I'm drawing 25 * 25 hexes on a 1000x1000 canvas. I also draw ...
2
votes
1answer
54 views

Best practice/way for client to speak with server

I'm making a multiplayer game in HTML5 Canvas and Node using Express and Socket.io. It's a platformer style game and so far the players are able to see each other and move around on the screen. It ...
1
vote
1answer
56 views

Javascript canvas check if all recs on the screen overlap a new one

So I know the AABB collision detection formula, however, this code does not work. Whenever I press space, a new square pops up. But this new square can spawn inside another, something that I do not ...
1
vote
0answers
52 views

Facebook Canvas (web) Game for Desktop & Mobile Browsers

as the title suggests - I am about to develop a game for FB canvas. Will the game support mobile and desktop or do I have to create two different project/game setups for this? thanks
1
vote
1answer
155 views

How do I check if one square is overlapping another in HTML5 canvas

I have a little program that goes like this: Whenever somebody presses space, a blue square appears. The blue square shouldn't overlap with any other blue square. But the function that is checking ...
5
votes
2answers
128 views

Create.js CPU High load

I'm new in Create.js and I'm trying to make countdown progress bar. I have this simple code: var stage = new createjs.Stage("timerCanvas"); stage.canvas.width = document.getElementById('...
1
vote
1answer
388 views

Android canvas.drawColor throws a null object reference

I have two nearly identical methods, the first to draw a splash screen while assets are loading, and the second to draw all of the assets to the screen. The first throws a NullPointerException on ...
6
votes
4answers
426 views

Rotating sprite around another sprite

I am building a pool game, and I want to make the cue rotate around the white ball. Here is the live code: http://199.26.84.223/nocol.html Here is the code for the white ball: balls = game.add....
1
vote
1answer
586 views

Building a simple bomberman game with Node.js and Socket.io [closed]

I'm building this game mostly because I want to experiment with Node.js and Socket.io, and the game is more like a proof of concept. To start with, I have a 2D grid system as the game map. ...
0
votes
1answer
59 views

What determines the hit detection ordering for graphic elements in Unity (2d game)?

I have a bunch of overlapping buttons spread across several UI Canvases. The default mouse behaviour only registers hover/click events with one of the overlapping buttons, which is ideal for my ...
0
votes
0answers
25 views

Performance slows down on click event

I'm currently working on a game in node using socket.io and drawing onto canvas. I'm noticing that when I click during the game, character movement slows to a crawl. For context: I'm updating x,y ...
2
votes
0answers
97 views

tilting image for mode7 game in HTML5

I'm making a mode7 game like mario-kart and I need to tilt the image before I draw it, I have tried using a buffer canvas to tilt the image then draw it on the games canvas but this makes it laggy (...
1
vote
3answers
2k views

Why does a UI button that is child to a canvas not appear in game view?

I am trying to place a button onto a canvas background using C# script. I want the button specific to the canvas (i.e., if I move the camera to look at another canvas, I do not want the button ...
2
votes
1answer
825 views

JS Canvas - Creating 2D Game lighting effect like Terraria

I just started working with canvas in HTML5 and with javascript. I'm pretty satisfied with my game so far: http://xenopal.dk/game-v1.1/. But I'd like to implement lighting as well in the style of ...
1
vote
1answer
180 views

Drawing/adding shape objects with the mouse on html canvas

I've started with the canvas paint tutorial from link which worked fine with a few problems that can be fixed later. I've been checking a lot of posts on drawing shapes on the canvas but they all use ...