Stickman Game (HTML/CSS/JS + C++/C & C# Code Snippets)

Controls: Left/Right arrows to move, Space to jump
// C++/C Stickman Game Logic Example (as comment)
/*
#include <stdio.h>
struct Stickman {
  int x, y, vy;
  bool onGround;
};
void jump(Stickman* s) {
  if (s->onGround) {
    s->vy = -10;
    s->onGround = false;
  }
}
void update(Stickman* s) {
  s->y += s->vy;
  s->vy += 1; // gravity
  if (s->y >= 200) {
    s->y = 200;
    s->vy = 0;
    s->onGround = true;
  }
}
int main() {
  Stickman s = {100, 200, 0, true};
  // Game loop would go here...
  return 0;
}
*/
        
// C# Stickman Game Logic Example (as comment)
/*
public class Stickman {
  public int x = 100, y = 200, vy = 0;
  public bool onGround = true;
  public void Jump() {
    if (onGround) {
      vy = -10;
      onGround = false;
    }
  }
  public void Update() {
    y += vy;
    vy += 1; // gravity
    if (y >= 200) {
      y = 200;
      vy = 0;
      onGround = true;
    }
  }
}
*/
        
// JavaScript Stickman Game (runs below)
/*
See the live game above!
*/