A new feature of HTML5, allowing Javascript apps to have a drawing surface in the browser.
0
votes
0answers
23 views
Adding multiple animated sprites on canvas make the game FPS drop sharply
I am using PIXI.js to build a html5 canvas game. Although this is PIXI.js specific question I think this may happen very often in HTML5 canvas games.
I have placed hundreds of static sprites in my ...
0
votes
1answer
25 views
How can I scale/zoom to a point in canvas in the game?
I am using html5 canvas to build a MMO game. When I scale my background by default it scales to (0, 0) which is the top left corner of the background. If I have other sprites on the screen they all ...
0
votes
0answers
12 views
How can I most efficiently key a color of a Three.js Texture?
I'm writing a model loader using three.js for an older format which requires textures to be in BMP format. I need to somehow replace a given color (specified in the texture source file name) with a ...
0
votes
0answers
39 views
Best way to render a 2d map?
I can't post more than 2 links (which I use for the images), that's why I have spaces in the links, remove the space between http:// and the link.
Please note this is a different problem than: http://...
1
vote
3answers
73 views
Is it alright to have hundreds of canvas object on screen?
I am using html5 to build a game and it is based on Canvas not webGL. I am trying to build sprites from canvas object not from images. Because there will be many sprites on the screen and each of them ...
0
votes
1answer
26 views
javascript game camera that follows my player
I am experimenting with game developement here but my player disapears my player is alowed to just walk of the screen and never be seen again so i was wondering if someone could help me with adding a ...
1
vote
2answers
60 views
How can I increase framerate, when drawing tiles to a HTML canvas?
I am using the HTML 5 canvas to make a simple platformer game. I am currently drawing the tiles using a for loop that runs through a list of tiles and checks if they will be drawn to the screen.
for (...
0
votes
1answer
68 views
Javascript game engine that can work 'seamlessly' with react-native
I have previous experience with Unity, but I don't like the fact that Unity compiles your game directly into APK (or IOS equivalent). It's because I want to modify the game to provide chat interface ...
0
votes
0answers
23 views
How to scale the screen in HTML5 canvas like “Circle Push”?
I would like to implement a scaling feature in my game like that of the game Circle Push which scales the map smoothly and I can hardly notice the changes when it scales. In Circle Push it works like ...
0
votes
1answer
26 views
Rotated canvas sprite not drawing properly
First, sorry for my english. Said that: Recently I began to study JavaScript and like a way to consolidate what I learned I decided to make a simple video game with canvas and javascript: kind of ...
0
votes
0answers
16 views
canvas tile engine optimal drawing technique
I'm building a top down racing game in HTML5. I'm currently experimenting with performance. I currently have about 8 layers that I draw on the canvas with the car in the middle and 4 background and 4 ...
0
votes
1answer
71 views
How to connect circle nodes using arrows?
I'm trying to design a simple game where a series of numbered circles can be connected by arrows (like mobile phone pattern locks).
I have these circles designed here: https://jsfiddle.net/sarmadm/...
0
votes
1answer
40 views
Camera movement, Draw grid
If I have a 20x10 grid (640x320) where tiles are 32x32
The grid are rendered:
for (var y = 0; y < 10; y++) {
for (var x = 0; x < 20; x++) {
var tileX = Math.round(Camera.x / 32);
...
0
votes
1answer
52 views
Perlin noise terrain issue when scrolling
I am generating a terrain in Javascript canvas using this js project for the Perlin noise. I have an array of points, and when one point leaves the left-hand-side of the window, it is removed, and a ...
2
votes
1answer
145 views
2d Tile Movement and Camera
Let's imagine we have a 60x60 grid (where a Tile is 64x64px). Within the viewport there should be 10 tiles. The player object is 32x32px.
To have smooth movement, I have to take delta time in ...
0
votes
3answers
58 views
How to make space invaders destructible scenery and conform it to a shape?
We all like the bases that can be destroyed by chunks being split out,
I originally implemented it by making a rectangle filled with individual squares (2x2 pixel size CANVAS rects) that would ...
0
votes
2answers
67 views
How to draw an image on canvas without html
I'm trying to add a sprite to the canvas of my game. However, I don't want to use an image tag. However, I haven't found a way to do this no matter how hard I searched. Something like:
var image = '...
0
votes
1answer
40 views
Character movement resetting x & y position in HTML5 game
I have an HTML5 game I'm working on and I'm at the point where I'm trying to make the character move. For the most part, the character(A rectangular square) is moving, but it's not moving from its ...
1
vote
0answers
110 views
Creating an Isometric tile map with HTML5
I'm trying to create an isometric tile map using HTML5 Canvas. Everything I've found online points me towards using a pre-built engine. I'd like to learn how to do this without using an engine. Is ...
1
vote
1answer
60 views
Infinite space 2d map - how to implement in js
Im not exactly sure how to implement this in JS.
So I want to have a 2d infinite map, but not tiled. The coordinates are there only so that if you are travelling around space you know in what ...
0
votes
1answer
24 views
Line rect intersection - lines behave like rays
Why is this? I have a simple ship that is a 14x14 rectangle, and a contour map. I want to be able to determine when the ship hits the ground. Here's a link to the JSFiddle.
Here's what happens now: ...
0
votes
1answer
30 views
Line rect intersection
I've been reading Timothy Wright's "Fundamental 2D Game Programming With Java". I'm trying to apply its principles to a Lunar Lander game - it's a JSFiddle for now, and can be found here.
The problem ...
0
votes
1answer
94 views
JavaScript - Updating a canvas real-time… from server-side or client-side
I have this 2D tilemap game 13x13 viewport (169 tiles drawn on canvas at a time) of a 150x150 map. Each tile is 32x32px. Obviously I only update the 13x13 viewport...
I want to update a canvas in ...
0
votes
2answers
96 views
HTML canvas, Node WebSocket and multiplayer game like slither.io. How to send visual data over websockets?
Where to start creating a multiplayer game like slither.io, agar.io, etc.
I need only learn how to draw live positions and other data of all players into one fullscreen HTML5 canvas with update ...
0
votes
1answer
57 views
How do I make an HTML5 canvas tiled map with tiles which have other than squared edges?
I'm creating an HTML canvas map and I'm trying to have the edges of the tiles not appear square, as in the tiles merge in to each other. I've scoured the internet for hours but can't seem to find ...
0
votes
1answer
59 views
2d animation on html5 canvas using a vector and speed
Im moving a starship from one location to the other. In creating a vector, normalize and magnitude it.
Lets assume my vector looks like this
Vector
x: 156,
y: -90,
m: 180.0000000546,
...
-1
votes
1answer
46 views
How to detect collisions of objects in two different arrays?(html canvas)
I am making a canvas game where you shoot at an endless amount of enemies. My problem is that the I am not sure how to make the objects from the bullets array collide with those of the enemy array. ...
-2
votes
2answers
59 views
Center of Image whose height, width and position are known
I have been struggling to find the center of an image(rectangle). I have following data with me:
width: w,
height: h,
position: (x,y)
My image is an object on canvas. I am using KonvaJS framework. ...
4
votes
1answer
35 views
Javascript canvas rotating single sprite instead of entire context
I am trying to recreate asteroids, but I need the ship to rotate based on user input. I have w,a,s,d keys set to change the [pos] of the ship by 1 in the corresponding direction, but now, I need to ...
0
votes
0answers
25 views
How Do I Create A Ga Sprite From An HTML5 Canvas?
I am attempting to develop a method of procedurally generating images for a game that I am making with Ga. The actual generation is not relevant here; my question is how do I turn an image on an HTML5 ...
1
vote
2answers
78 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
386 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 ...
-1
votes
1answer
99 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. ...
2
votes
3answers
112 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
1answer
58 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....
0
votes
1answer
111 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
116 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 ...
2
votes
1answer
64 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
95 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 ...
4
votes
1answer
131 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
140 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
34 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
126 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
0answers
12 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
2answers
108 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
17 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
75 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
78 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
588 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
136 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 ...