Jump to content

[WIP] Space Pizzas: A multiplayer top-down shooter with pizzas


mtmckenna
 Share

Recommended Posts

Hello, everyone!

 

I've been working on a multiplayer top-down shooter called Space Pizzas. I'm hoping it may some day become the best space-based pizza game on the web, but we shall see how that goes. Here's a gif of the work in progress:

 

space-pizzas-tigsource-2.gif.607ce66ac56878bbade40379912500ce.gif

 

The game uses Ember.js as its base, Three.js for the visuals, and a billion more JS libraries to do everything else. I also begrudgingly wrote some code when there truly was no other option.

 

The game is playable online in its current state at https://www.spacepizzas.com. Space Pizzas allows for up to six-player pizzamatch (like deathmatch for pizzas) and can support multiple simultaneous games if things go well and more than six people hit the site at the same time.


The game hasn’t had a ton of play testing, so please let me know what you think!

Link to comment
Share on other sites

13 minutes ago, mtmckenna said:

Hello @caymanbruce ! Thank you for finding the bug! I saw the error pop up in my bug tracking tool. I deployed a fix, but I'm not entirely sure I solved the problem since I wasn't able to reproduce it on my machine. I think it's a weird race condition in my code (alas...). Would you mind giving it another shot? Thank you!

Still the same thing. No luck.

Link to comment
Share on other sites

Darn it! Do you know what year your MacBook is? Looks like this might be a weird Three.js/Chrome bug.

On the above bug report, it looks like some people had luck trying...

  • ... a different browser like Safari/Firefox
  • ... making sure a "use hardware acceleration when available" checkbox was checked in the Chrome advanced settings (first screenshot attached)
  • ... disabling "automatic graphics switching" in your "energy saver" settings on OS X (second screenshot attached)

Would you mind giving those options a try? I really appreciate it!!

Thank you!

 

58b65b0b2d54a_ScreenShot2017-02-28at9_24_11PM.png.f7bd0ff6543d1948872fc550561bd56b.png

yosemite-system-prefs-energy-saver-automatic-graphics-switching-disable.thumb.png.97c66a48761dbfcd30acb95569090791.png

Link to comment
Share on other sites

Hello! This weekend, I added bots to Space Pizzas.

 

Now, whenever there are fewer than the maximum allowable number of human players (4) in the game, a bot will be added in their stead. Here’s a GIF of the bots (the ships in white) in action:

space-pizzas-tigsource-bots.gif.0022d20c7942f01c4cbd763fa6096c19.gif

In case it’s interesting to anybody, I made the bot “AI” really basic--the bots mostly move randomly, hitting the gas 75% of the time and turning 15% of the time. Here’s the code:

import { didThingHappen }  from './util';

const CHANCE_OF_CONTINUING_TO_GAS = 0.75;
const CHANCE_OF_CONTINUING_TO_TURN = 0.15;
const CHANCE_OF_TURNING_LEFT = 0.50;

export default class {
  constructor() {
    this._currentInput = { gas: 0, turning: 0 };
  }

  get input() {
    let gas = this.nextGasInput();
    let turning = this.nextTurningInput(this._currentInput.turning);

    this._currentInput = { gas: gas, turning: turning };
    return this._currentInput;
  }

  nextGasInput() {
    return didThingHappen(CHANCE_OF_CONTINUING_TO_GAS) ? 1.0 : 0.0;
  }

  nextTurningInput(turning) {
    let direction = this.directionToTurn(turning);
    turning = didThingHappen(CHANCE_OF_CONTINUING_TO_TURN) ? direction * 1.0 : 0.0;
    return turning;
  }

  directionToTurn(turning) {
    let sign = Math.sign(turning);

    if (sign === 0) {
      sign = didThingHappen(CHANCE_OF_TURNING_LEFT) ? 1.0 : -1.0;
    }

    return sign;
  }
}

 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...