pht59x

LD29

LD31

Hello World (2) !

Same tools as last time, ie CoffeeScript. Likely not to be bothered with sound nor music.

Subject to lots of ifs, game concept will be “playable” at

http://pht59x.eu5.org/

Plenty of fun to all !

pht59x

Greeny GRUB

Whenever you play Greeny GRUB could you please let me know where you died.

Thanks.

PHT

Greeny GRUB is less than 500 lines of CoffeeScript

It only relies on the HTML5 API and does not require graphics assets.

greeny_grub_intro

Might Greeny GRUB be the shortest entry in this JAM?

What about yours?

Comments

19. Dec 2014 · 05:04 UTC
The Tower is a 311-line HTML+Javascript document, along with a 46-line CSS file. 😉

Greeny GRUB has better looking GREENs

  • + growing (ie more dangerous) REDs from level 10 upwards;
  • + 20 better-balanced levels for 20 minutes of fun;
  • + player stat at the end of the game (how much time spent per level);
  • + WASD, ZQSD, IJKL or arrows.

greeny_grub_statas before, you will also get:

  • frustrating, weird, funny controls you will learn to master quickly;
  • the R-key for direct access to a random level;
  • Bach’s superb BWV 661 chorale prelude;
  • instant gaming in your browser.

There is nothing weird with Greeny GRUB controls

WTF with the weird controls in Greeny GRUB? Here is some explaining. Keep reading if you know a little bit about CoffeeScript, Python or C-like syntax:

# Cursor-keys handling
document.onkeydown = (event) ->
__deltaVelocity = 80 # in pixels per second
__switch event.keyCode
____when KEY_UP then player.adjustVy(-deltaVelocity)
____when KEY_LEFT then player.adjustVx(-deltaVelocity)
____when KEY_DOWN then player.adjustVy(deltaVelocity)
____when KEY_RIGHT then player.adjustVx(deltaVelocity)

where deltaVelocity will be used by:

  • player.adjustVx() and player.adjustVy() to update vX and Vy velocities.
  • player.update(fps) to update x and y coordinates


class Player
__constructor: (@x,@y,@vX,@vY) ->

__adjustVx: (deltaVx) ->
____if Math.abs(@vX)<100 or (deltaVx>0 and @vX<0) or (deltaVx<0 and @vX>0)
______@vX+=deltaVx

__adjustVy: (deltaVy) ->
____if Math.abs(@vY)<100 or (deltaVy>0 and @vY<0) or (deltaVy<0 and @vY>0)
______@vY+=deltaVy

__update: (fps)->
____@x+=@vX/fps
____@y+=@vY/fps

The weird behaviour comes from the fact that there is no damping on the velocity once it has been passed to the player’s methods and that I do not handle onkeyup events.

Comments

26. Dec 2014 · 08:16 UTC
How come I am seeing this post for like the fifth time? Are you reposting / editing it or something?
pht59x
26. Dec 2014 · 09:24 UTC
I have changed the title, hence 2nd time and not 5th. I have also deleted the old one.
26. Dec 2014 · 09:40 UTC
Fair enough …

Greeny GRUB: post-mortem

Timeline

  1. Saturday was spent implementing the physics of billiards in CoffeeScript;
  2. Sunday (afternoon) was used  to put together the game mechanic main ingredients: the goodies will be GREEN, the baddies will be RED, the player wiil be grey and the controls will feel both weird and funny;
  3. Monday (lunchtime) I got the weird controls tested by 5 real-life testers.

 

greeny_grub_playing

What went right

  • CoffeeScript to make a game in a single 500-line file: no library, ie plain JavaScript under the hood;
  • I did not use nor make graphics assets;
  • testing with Firefox, Chrome, IE (v > 10) and Opera;
  • I eventually got the game balancing right on 20 levels (ready for more…);
  • working with Linux on a computer with a tiny 750 MB RAM and the same amount of swap space.

What did not go so well

  • most of the physics stuff I wrote on Satruday was not used in Greeny GRUB;
  • some (minor) sound issues;
  • not enough votes!

If I had to do it again

  • I would stick to an HTML game with CoffeeScript.
  • single file programs are handy to try out different options.
  • again, I would ask myself whether using a game/physics library is a better idea than writing everything from scratch.

Thank you to

  • my real life testers who gave me quick precious feedback early in the project;
  • those of you who commented on the game or rated it for the past 3 weeks;
  • Spouki who earned me a massive 1 vote because he is cute.

 

spoukiClick on me to make my owner happy!

Spouki is having a problem, too.

spouki7 hours left !

Comments

Geckoo1337
29. Dec 2014 · 17:10 UTC
Keep the faith boy :)