mtmckenna Posted February 27, 2017 Share Posted February 27, 2017 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: 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! Quote Link to comment Share on other sites More sharing options...
caymanbruce Posted March 1, 2017 Share Posted March 1, 2017 All I can see is a spinning pie when I go to your website. I hope it will be online soon. Quote Link to comment Share on other sites More sharing options...
mtmckenna Posted March 1, 2017 Author Share Posted March 1, 2017 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! Quote Link to comment Share on other sites More sharing options...
caymanbruce Posted March 1, 2017 Share Posted March 1, 2017 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. Quote Link to comment Share on other sites More sharing options...
mtmckenna Posted March 1, 2017 Author Share Posted March 1, 2017 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! Quote Link to comment Share on other sites More sharing options...
mtmckenna Posted March 5, 2017 Author Share Posted March 5, 2017 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: 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; } } Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.