Tagged Questions
0
votes
1answer
42 views
How can I draw a small bitmap on a larger bitmap at a particular position? (Canvas / SurfaceView)
I'm building a game that requires additive blending of colours for certain bitmaps.
Say I have 4 different types object, there are maybe ten of each type on the screen with each type having a ...
0
votes
1answer
210 views
Implementing a camera on HTML5 canvas?
I am trying to work out the best way of implementing a camera in my simple 2d game.
The way it is structured at the moment is my game objects all have draw functions, which are passed a canvas ...
6
votes
1answer
310 views
How to create 2D shadows
Could help about creating lighting and shadows in a 2D environment, like the image below.
http://i.stack.imgur.com/0FEQz.gif
I did several searches but got no results
( ps: sorry my bad english i'm ...
1
vote
3answers
570 views
Need Guidance Making HTML5 Canvas Game Engine
So I have some free time this winter break and want to build a simple 2d HTML5 canvas game engine. Mostly a physics engine that will dictate the way objects move and interact(collisions, etc). I made ...
1
vote
2answers
122 views
Which structures to use for maintaining 2D objects on canvas? How to map clicks to objects?
I need to draw some 2D objects on a canvas. And I need to map the 2D coordinates of clicks to objects.
What is the usual way to maintain a 2D object's size and position (which data structures, ...
1
vote
3answers
481 views
Android, how important is deltaTime?
Im making a game that is getting pretty big and sometimes my thread has to skip a frame, so far I'm not using deltaTime for setting the speed of my different objects in the game because it's still not ...
5
votes
2answers
527 views
android multitouch problem
Im aware that there a a couple of posts on this matter, but Ive tried all of them and none of them gets rid of my problem.
Im starting to get close to the end of my game so I bought a cabel to try it ...
-1
votes
0answers
64 views
ball 2d animation [duplicate]
Possible Duplicate:
canvas ball physics animation
I want to animate ball in html canvas like this.
ctx.beginPath();
ctx.arc(75, 75, 10, 0, Math.PI*2, true);
ctx.closePath();
ctx.fill();
...
3
votes
2answers
531 views
canvas ball physics animation
I want to animate ball in html canvas like this.
ctx.beginPath();
ctx.arc(75, 75, 10, 0, Math.PI*2, true);
ctx.closePath();
ctx.fill();
start position is left top corner and ball's maximum ...
1
vote
2answers
563 views
Matrix rotation of a rectangle to “face” a given point in 2d
Suppose you have a rectangle centered at point (0, 0) and now I want to rotate it such that it is facing the point (100, 100), how would I do this purely with matrix math?
To give some more specifics ...
2
votes
2answers
385 views
Collision Detection doesnt work because some things move more than 1px at a time
I'm writing a 2d scrolling game in javascript using canvas and since I'm limited to setInterval running at minimum once every ms, I need to have some objects moving at greater than 1 pixel a second. I ...
3
votes
1answer
1k views
Optimizing HTML5 canvas transformed drawing in Javascript
I am trying to optimize my HTML5 game engine and have noticed that currently a majority of the time taken in the game loop can be taken when drawing transformed tiles. I think this is because each ...
2
votes
2answers
697 views
Canvas Rotation collision detection on a sprite
I am using this code to detect collisions between two rectangular sprites.
intersect: function(other) {
return this.x < other.x + other.width && other.x < this.x + this.width ...
6
votes
1answer
647 views
Set sprite to face direction of mouse
I'm building a html5 canvas game and I need a way to get my sprite to face the mouse cursor. I have the X and Y co-ordinates for the sprite, and also the X and Y co-ordinates of the pointer. All I'm ...
4
votes
2answers
696 views
Calculating the angular direction from velocity
I'm trying to calculate the angular direction of a projectile, knowing it's X and Y velocity I can find the magnitude of its movement, but I'm having a hard time wrapping my mind around getting the ...