Textures in javascript Canvas

Started by
1 comment, last by StratfordCanning 11 years ago

Morning All,

I've written a working game and I'm pretty pleased with the physics and the look in general, but I'd love to make the ground look sandy or grassy. The texture needs to move around in a realisitic way when the viewpoint moves so I can't just load a picture of some sand. Are there any plausible ways to achieve this with the canvas in javascript? Google has not enlightened me!

Use the arrow keys to roll the ball around and chase the rubies:

http://www.moonsch.com/games/nonrigid/nonrigid.htm

Advertisement

so I can't just load a picture of some sand

Why not?

Frankly a texture is just a picture... not really sure what it is you are going for here... does the sand image need to move, or do you simple need the sand layer to stay stationary while the viewport moves? Both can be achieved with canvas, yes.

Serapth, thanks for the reply, I think I've done what I think you mean, take another look. It doesn't look right, I'd like it to rotate as the view rotates and scale properly as it moves into the distance.

This topic is closed to new replies.

Advertisement