Little Jumping Thing

I’ve done this little animation inspired on a Cocos tutorial that I found. The mountains and sky are procedural and it runs at 60 FPS.

I hope you enjoy.

That’s awesome, nice work!

Hi @pepinganos,

Got to agree with @toadkick here - awesome, superb - I will go through your code to see if I can understand it (unlikely). Hope I can learn a lot from it.




That’s lovely. Very nicely done.

Very nice looking video. Thanks for posting it and the code.

However, copying and pasting from github creates an error in each class tab. A couple errors were formatting issues via email I suppose but some errors are a little over my head.

I’ll keep trying to figure them out but wanted to know if anyone else had any errors.

Thanks again.

@Keebo, I don’t know what can be causing that. Maybe you could try to transfer the code with iExplorer.

@Bri_G, I’ve tried to comment the code as clearly as possible and to keep it as simple as possible in order to be “pedagogical”.

I also think it’s optimized enough to allow to construct a true game without losing the 60 FPS.

Hi @pepinganos and @Keebo,

Thanks for the code, too tied up with other things at the moment to digest it fully, but will no doubt be back for advice later.

On the github front, I think there is a download link, there certainly is when I out the code in on my gists.





I got it working with iExplorer. Thanks for the tip.

@pepinganos, this is a very nice project. Looking forward to learning from it.

Thank you for sharing.


Absolute amazing,I was looking for a good way to do this long time ago in this post

Thank you so much :slight_smile:

Great work, @pepinganos!

I have an error

error: error: [string “Hills = class()…”]:77: attempt to index field ‘?’ (a nil value)


  • position.x = -1939952
  • hero.ball.x = 395.409
  • hero.speed = 940

Looks like self.keyPoints[self.toKeyPoint] is nil, i am investigating O:)

Hola @juaxix,

It’s not an error, it’s a feature…

Now seriously, that error arises when you get to the end of keyPoints[], then the program stops. Remember it’s not a finished game, only an engine. You have to test for the end of the points in the array.

Ah, it is more simple than I was thinking :slight_smile:
Thanks you so much for the code, i am preparing a new game with this :slight_smile:

@pepinganos Your lovely demo has now been resurrected on the Codea Community Repo for everyone to enjoy once again :smile: