How to store the position of enemies on stage for a game in HTML5 and Javascript?

I`m trying to make a game like Doodle Jump and I need to generate the lines, where the character can jump on, but I have no idea how to do it, or how to store the position of each line on what the character can jump on. And there should be something to limit the number of lines as the game advances to make it more and more difficult, but without have impossible situations.

My main question is what would be a good method to store the position of each line ? Thanks in advice


There is a tutorial over here which shows you how to build a doodle jump style game using HTML5 Canvas

In that example the developer creates an array of platform objects and draws them to canvas and then does some simple collision detection:

var GameLoop = function(){

if (player.isJumping) player.checkJump();
if (player.isFalling) player.checkFall();



gLoop = setTimeout(GameLoop, 1000 / 50);

Need Your Help

hash using multiple array value in ruby

ruby-on-rails ruby hash

How I'm trying to build a hash for the following input

How to insert ($x-$y) inside a bash printed string

linux bash shell command-line sh

I have this simple problem but I am very unfamiliar with bash syntax;