0

I'm making an HTML5 game and I'm new to this, My issue is that I'm making a 2D game and I have a background that is bigger than my canvas.

I need that when my main object moves the camera moves with it so new background parts appear? But also that the rest of the objects disappear when required.

A little example will be

http://www.realmofthemadgod.com

Thanks

Gustavo Carvalho
  • 2,798
  • 1
  • 19
  • 25
Raggaer
  • 3,244
  • 8
  • 36
  • 67

1 Answers1

1

Here is a good example from Simon Sarris:

jsFiddle link

Ignore the line below - posting a jsFiddle link requires accompanying code - which is too long to post!

var showFiddle = true
Community
  • 1
  • 1
Jarrod
  • 9,349
  • 5
  • 58
  • 73
  • 1
    +1 for nice starting scrolling-game template in your Fiddle. Also, thanks for making me smile with var showFiddle=true. :) – markE Jun 06 '13 at 23:24
  • haha, thanks. But credit goes to Simon Sarris for creating that. – Jarrod Jun 06 '13 at 23:29