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
1 answer
90 views

I've just started getting into 2D game development and have been experimenting with some 2D collision and correction logic in canvas. I'm trying to debug this block of code and understand why it is ...
Jacob Goldstein's user avatar
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
0 answers
109 views

I have a problem when creating a texture with WebGL. The thing that I do not understand is that the first call with texSubImage2D with a canvas leads to the ...
hoangphatmonter's user avatar
0 votes
1 answer
247 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
1 vote
1 answer
224 views

Game Genie was a tool for the NES that allowed users to input codes that were able to drastically able to change the mechanics of a game by getting CPU reads and replacing the game's response with its ...
Jake Miahn's user avatar
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
2 answers
379 views

I am currently making a game in HTML5 using canvas, and it is currently just 1 js script and HTML file with references to png files for assets. Right now, I have the level data baked into the script, ...
Stormzy18'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
76 views

Hi There this is my first Post on gamedev, and i hope everyone understand what i want :) First of all my Code is an very Personal Version from one Github Isometric Map. I Tryd now 2 Days to Add the ...
Tobias B.'s user avatar
0 votes
1 answer
94 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
0 votes
1 answer
40 views

Using adobe animate cc - exporting to HTML5 and coding in JS (or at least trying to) If I just hit cntrl+enter in adobe animate the button works as expected. If I run the app from a web server using ...
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
883 views

I'm new to html canvas. So far I am following this code as base for simple isometric tiles. I made an empty isometric grid map that only shows the grid. I want to offset the position of my isometric ...
James Allan's user avatar
0 votes
1 answer
202 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
292 views

I'm trying to animate a sprite sheet. I have a single image, and multiple objects of the same type but drawn at different locations on the canvas. What I'm trying to do is have each object move with ...
kqvanity's user avatar
0 votes
1 answer
89 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
432 views

I cant seem to get breadth first search right. Ive gone through redblobs implementation guides of hex grids and have that all figured out but pathfinding is proving to be difficult. So I have a search ...
cwahlfeldt's user avatar
0 votes
1 answer
151 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
0 votes
1 answer
503 views

I have multiple canvases placed on top of each other for different layers (background, game objects, foreground). I was expecting this to allow me to have the background and foreground update at a ...
Batash's user avatar
  • 3
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
554 views

...
Buckets's user avatar
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
2k views

I have this function to get the rotation angle from my sprite and a target: ...
Pavul Zavala's user avatar
0 votes
1 answer
125 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
0 answers
37 views

I am really new to mixing physics and game development, and I would like to find the initial velocity required to launch the gray dot from point A to point B, given a time. I’ve tried many tutorials ...
user153929'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
1 vote
1 answer
127 views

I'm making a game with HTML canvas (not WEBGL). I have zombies that go to the center of the screen, but for now they are just circles. I want to give them two arms, like the arms players have in ...
Justiniscoding'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
2 votes
2 answers
2k views

I am making a recreation of the 2D voxel game Terraria in JavaScript. Like most sandbox games, Terraria has lighting, but because I am using JavaScript, performance is going to be an issue. I have ...
luek baja's user avatar
  • 123
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
0 votes
1 answer
160 views

I am trying to generate a map based on the Golden Ratio: a+b is to a as a is to b. I was looking at a JavaScript math library that had a built-in phi, but I wasn'...
oxr463's user avatar
  • 103
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
7 votes
1 answer
5k views

I'm making a game with a canvas scaled up such that each pixel is pretty big. I want to display some pixelated text without anti-aliasing but I have idea how I would accomplish this. Is there I way ...
mushrombrother.jpg'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
0 votes
1 answer
414 views

I'm trying to make the Mario move, but somehow it leaves traces behind, can anybody help??? ...
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
2 answers
1k views

I am scaling my world space UI element as my camera go far away from UI using this code snippet: ...
Muhammad Faizan Khan'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
1k views

i need a help i have an Isometric Staggered tile map in Tiled (mapeditor.org). 100x100 tiles, 94x54px, 9447x2727px. total. How can i make this in html5 canvas ? var context = document....
vsys's user avatar
  • 1
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
0 votes
1 answer
275 views

I'm making a chess game from scratch and I got stuck. So far I have all my figures placed, I have the positions set, I've already done the collision detection and everything. When I click the figure ...
Chrissisbeast'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
702 views

so I am making a 2d canvas game in Javascript and I want the enemy mobs to shoot a bullet every let's say 3 seconds. I'm almost done with the code , i made everything i just don't know how to make the ...
Chrissisbeast's user avatar
0 votes
1 answer
917 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 votes
1 answer
526 views

In my blogger blog: https://cglabprojects.blogspot.com I have a newer blog post with <canvas width = "570" height = "570" id = "my_Canvas1"></canvas> ...
Som Pra's user avatar
  • 103
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
0 votes
2 answers
113 views

I have a boss appearing in my game, but since it's only one character I didn't put it in an array. Now I'm trying to make disappear if its health is less or equal to 0 but I don't know how to do that. ...
Chrissisbeast's user avatar
-1 votes
2 answers
645 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 vote
1 answer
473 views

I'm creating a game where waves of enemies are coming to me and I have to kill them. So far, I'm doing great: it took me hours to come up with this nested loop to check for collision detection and ...
Chrissisbeast's user avatar

1
2 3 4 5
8