Skip to main content

Questions tagged [html-canvas]

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

Filter by
Sorted by
Tagged with
0 votes
0 answers
61 views

I created a game using xml and views on Android. Yes, I know it was not the best choice of development for a 2d game. But, my game is turn based, so mostly static. You can test the game out here: ...
i_o's user avatar
  • 131
1 vote
0 answers
60 views

similar to rpgs with a popup window and text options. like stardew valley. Are there any common approaches to implement this?
Max Link's user avatar
0 votes
1 answer
246 views

I'm developing a game using the html5 canvas, but I've never used it before and I'm having difficulty creating a camera. The intention is that it is the same as agar.io, where the player is centered ...
Jhon's user avatar
  • 1
0 votes
0 answers
84 views

In a browser game made in HTML5/Javascript, I would like to handle the move of units in real-time. But units would have to follow some predefined roads... Canvas seems better than svg to handle ...
Charles Dexter Ward's user avatar
0 votes
0 answers
183 views

So this is the setting that is affecting my game. My game is a webgl build from unity running in chrome, hosted on itch.io. At 100% windows scaling setting, the UI elements have expected size,...
Utkrist Karkee's user avatar
0 votes
1 answer
93 views

I am having some issues figuring out why this code still lets btn_1 call the function setstate3(). There is a function ...
subtlefly's user avatar
1 vote
1 answer
1k views

I create a WebGL game. After building project I discovered that the game doesn't fit the screen size How you can see the canvas is perfectly scaled but the game didn't I don't know what I changed but ...
EzioMercer's user avatar
0 votes
1 answer
200 views

In my game there's a part where a bunch of circles need to evenly spread around a point. Like in this demo below: ...
Ryan Peschel's user avatar
0 votes
1 answer
88 views

Lets say there are 5 units, displayed as images on an html5-canvas. Each image (unit) has a different size. For the game I need to know the size of that unit, and also it's middle point. How and where ...
23rfew's user avatar
  • 1
0 votes
1 answer
150 views

I would like to move my landscape to simulate a world moving on the x-axis. I use createPattern() to add an image inside my path, but the pattern draws the image at ...
Leo_xfh's user avatar
  • 11
3 votes
0 answers
1k views

What I'm trying to do: I'm trying to add touch controls to games created with the html canvas and JavaScript so that they can be used on mobile / tablet devices. The controls should simply move a ...
Fishbite's user avatar
  • 141
0 votes
1 answer
2k views

I have a heightmap that scales from 0 to 255. the map is only for elevation (discluding water and ice) what would be the appropriate way to calculate the scale of one meter? heightmap below
Ahmed Rahmi's user avatar
0 votes
1 answer
124 views

I am making a HTML5 game using javascript with canvas. I am implementing a custom font adding @font-face style tag to header in the .html file, then if I set ...
Pavul Zavala's user avatar
1 vote
1 answer
1k views

I am trying to set up an environment for a retro style pixel art game in Unity 2D. I aim for a vertical resolution of 240 pixels, and then, I would like the horizontal resolution to be dependent on ...
Gergely Kovacs's user avatar
2 votes
2 answers
3k views

I'm developing a top-down 2D tile-based canvas game. I have a single sprite sheet of all my tiles, and then a JSON tile map array of where they're placed. Previously I would render all the layers of ...
Ryan Peschel's user avatar
0 votes
1 answer
55 views

When you run the project, you can see that the first circles have a black border around them. When I remove the Game.drawLines(), the circles don't have the border ...
stonefish's user avatar
3 votes
3 answers
3k views

So I come from C++ land where I've always done every little thing myself. Now I'm getting into Unity and C# and I'm ironically overwhelmed with the domain. I'm starting off with this simple little 2D ...
Josh Sanders's user avatar
1 vote
1 answer
1k views

I tried to draw Mario Sprites in my HTML Canvas, but it always went blank. Anybody knows why? ...
stanley355's user avatar
2 votes
2 answers
5k views

I'm trying to create a game in HTML canvas, but somehow it keeps flickering, I've taken a look at the tutorial and I perceived that my code is more or less similar. Can anybody help me fix this? <...
stanley355's user avatar
0 votes
1 answer
451 views

i'm making a snake game in javaScript from scratch. The problem is that the snake looks disjoint(see image). How can I connect the body(rectangles) of the snake? here is the code of drawing snake: <...
Manik's user avatar
  • 107
0 votes
0 answers
38 views

I am having problems with collision detection. I am trying to make a simple platformer but when the player is falling or moving too fast it sometimes detects the wrong collision side. I am getting the ...
Wojak2121's user avatar
-1 votes
1 answer
2k views

I am making a 2D canvas game in JavaScript. I am trying to make the enemies shoot a bullet every 3 seconds. ...
Chrissisbeast's user avatar
0 votes
1 answer
913 views

I am making this 2d canvas game in JavaScript and I want to switch to file level2/level2.html when the boss of level 1 (...
Chrissisbeast's user avatar
1 vote
0 answers
74 views

Having a lot of trouble with my collision detection in my platformer. If you go straight to the right the block will float. Also the corners let the block sink right through and the walls are sticky. ...
Charlie K's user avatar
-1 votes
2 answers
644 views

So im doing this program where i want my hero to shoot to the direction its facing , but for this job to get done i need to calculate the angle my hero is facing with Math.atan2() , atleasts thats ...
Chrissisbeast's user avatar

1
2 3 4 5
8