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

learn more… | top users | synonyms

1
vote
2answers
318 views

Algorithm to zoom a plotted function

I'm making a game in android and I need plot a function, my algorithm is this: @Override protected void onDraw(Canvas canvas) { float e = 0.5f; //from -x axis to +x evaluate ...
0
votes
1answer
56 views

collision detection algorithm issue

here is the jsfiddle i am working on so far : http://jsfiddle.net/TLYZS/ if you debug the code and check the collision function you can see that the collision is working fine when the user overlap ...
0
votes
1answer
35 views

Dealing with multiple animation state in one sprite sheet image using html5 canvas

I am recently creating a Game using html5 canvas .The player have multiple state it can walk jump kick and push and multiple other states my question is simple but after some deep research i couldn't ...
0
votes
1answer
245 views

Should I render all of my HUD views to a single SurfaceView?

I'm using a SurfaceView and canvas to implement a game HUD, title screens etc., by overlaying standard Android view widgets over my SurfaceView. This works reasonably well and maintains an acceptable ...
0
votes
1answer
3k views

How To Scale Canvas In Android

I am writing a android game using Canvas as the way to draw everything, the problem is that when i run it on different android phones the canvas dosn't change size i tried using canvas.scale() but ...
-1
votes
1answer
259 views

View port for my canvas game

I am developing a canvas game, and im struggling to get my head around how i can make a view port so when the character moves the world moves with it. Unlike traditional 2d maps built with arrays i ...
4
votes
0answers
142 views

How to do a genetic algorithm's chromosome which controls movements

First I would like to inform you that I'm french and 15 so my english is not very good. I've read some articles about genetic algorithms (GA) and since I discovered the HTML5's canvas element, I can ...
2
votes
0answers
303 views

Poor performance in android when running APK, runs fine in browser

I have created a small game project in HTML5 using Phaser engine (tried both 1.1.5 and 1.1.6). Then to port it to mobile platform, used Phonegap/Cordova for Windows Phone 8, Android and iOS. In my ...
1
vote
0answers
52 views

Improving performance on older Androids

I'm learning to build html5 games for mobile. I'm worried about the FPS animation on older model Android... as I use a lot of setTimeouts to update certain aspects and would like some suggestions on ...
1
vote
0answers
242 views

Drawing two orthogonal strings in 3d space in Android Canvas?

I want to draw two strings in canvas. The first string must be rotated around the Y axis, for example 45 degrees. The second string must start at the end of the first string and also it must be ...
1
vote
0answers
69 views

How to work with edge Texture

Im not sure if i use the right terms, but im not able to find something to start with. Im trying to develop a little HTML5 game. I have a ground with a texture and now I want to make a surrounding ...
0
votes
0answers
34 views

HTML5 Canvas: Get rect coords after rotation (relative to screen)

update: function(delta) { for (var i = 0; i < this.bullets.length; i++) { this.bullets[i].velocity = this.bullets[i].speed * delta; this.bullets[i].contextX += ...
0
votes
0answers
62 views

Make bitmap moviment on android canvas using timer or handler/Runnable/postDelayed

Im trying to to move enemies on a android canvas, i have to update its x and y position every x time (run enemy.move() every x time). I got 2 problems: Currently im implementing my canvas redraw ...
0
votes
0answers
41 views

What would be a good way to scroll a large html canvas (that contains little repetition if any)

What would be a good way to scroll the content of a huge html5 canvas so that the scroll is crisp and smooth, and memory consumption (and cpu load or battery consumption) is also reasonable? any ...
0
votes
0answers
54 views

detection of a circle inside a rectangle in html5 canvas

I've created this game where the player can hit space to make the circle float in certain way. the main goal of the game is let the circle enter the rectangle .I did this code to create a collision ...
0
votes
0answers
76 views

Coordinate system of android.graphics.Camera?

I asked this question before in StackOverflow.But I have not found any answer. I have to use Camera to draw some things in Canvas.But I can not detect that coordinate system of Camera is Right hand ...
0
votes
0answers
18 views

Fixed print on GLCanvas surface

Having extends class of GLCanvas and I want to print some fixed texts and pictures on its surface. What is the intelligent solutions for that ? So far I have - class PhaseOne extends GLCanvas ...
0
votes
0answers
80 views

Bouncing objects against the side of the screen

I want to have certain circular objects bounce against all four sides of the screen. After searching a lot on the internet, I found the following formula: Vout = Vin - ((1+e) *dot(Vnormal, Vin) * ...
0
votes
0answers
52 views

how to set resolution in cocos2d html5 game

how can i change or init game with specific resolution is there something like setResolution(width,height) available ? please hellp thanks in advance
0
votes
0answers
713 views

Android Canvas problems with drawing background

I'm trying to make an android and i have got to the stage where im adding in some simple graphics and it gets drawn to the screen fine but it is drawn over the top of everything else here is the code ...