Couch Multiplayer With Pico-8 - Part 1

On Saturday, November 2nd 2019, 7:08:51 pm by Lee Nattress

Intro

For a little while now I've been writing a little game in the fantasy console Pico-8, a software only retro console, with refreshing limitations. I have made a few other games with this software, but I wanted to make a couch versus game. One that could only be played with friends. I've always wanted to write a game like 'Combat' on the Atari home games console. Lets break down my quick design, and then we'll just wing it from there.

Requirements

  • A game like Combat on the Atari
  • 2,3 or 4 players at the same time on the same screen
  • Rotational controls, like a tank
  • The best graphics I can manage
  • Everything to fit on one screen
  • Fighting to be fast and furious
  • Juice

Combat?

Combat, Atari 1977

Combat, Atari 1977

Combat is a video game by Atari, Inc. for the Atari 2600. It was released as one of the nine launch titles for the system in September 1977, and was included in the box with the system from its introduction until 1982. Combat was based on two earlier black-and-white coin-operated arcade games produced by Atari: Tank (published under the Kee Games name) in 1974 and Jet Fighter in 1975.

Wikipedia - https://en.wikipedia.org/wiki/Combat_(Atari_2600)

Though there were a few other game types on the cartridge, I really liked the tank one, so I'll be mainly re-making that. Perhaps I'll try my hand at the others later.

In Pico-8, we use sprites that are 8x8 pixels in size and draw them to the screen. In this game I want some more eye candy than the basic shapes of 'Combat'. I'm going to do something I saw on the Pico-8 forum and twitter, sprite stacking.

I took this stack and placed them slightly above one another. With a little sprite rotation magic, I get this:

The sprite rotation code can be found here: https://pastebin.com/E2dG0aji

The code I use to draw the player with rotated sprites looks something like this:
https://pastebin.com/TZ49i6rM

So, I have my tanks, so lets get a playing field in there. I need something for the players to hide behind and dodge around.

This shows using Pico-8 map() function to draw something for the players to move around in. I'm using a very simple way to detect a collision.

--tile colliders
function solid(x, y)
  val=mget(flr(x/8), flr(y/8))
  return fget(val, 0)
end

It's time to add some more flare to those dull tiles. I'm going to stack one set of tiles on top of another, to give the same illusion of depth as we give from our tank sprites.

As you can see here, the tank seems to go behind the buildings. The stacked tiles look like this in the editor, It's just two maps.

So, we have our players, and we have our first arena, so how about shooting? This next gif shows a couple of things, first, the players need to have something that tells them what player they are, so I added a little billboard above the player, in their colour.

Boom! Look at those explosions and screen shake! Lets add some more juice. I want some sparks when I scrape against the wall.

Groovy.

Thats all for now. In part 2 we will be adding a way for players to opt into a game, a scoring system and some more maps.

Bye for now!

Short Bio

Lee Nattress profile image
Lee Nattress

I'm an enterprise software and cloud architect with over 20 years experience in making solutions that are secure, scalable and performant. My focus is on serverless micro service architecture in AWS.

Job

I work at 3t Transform. I'm super happy there. We write training and compliance software and make VR digital twins.

Social

Recent

Multi-browser Automated Testing with Selenium and...

Saturday, November 2nd 2019, 9:36:02 am

Designing and 3D Printing My First Useful Thing

Saturday, November 2nd 2019, 1:57:25 pm

Space Engineers IRL: Hydroponics Build Part 1

Saturday, November 2nd 2019, 4:48:10 pm

Couch Multiplayer With Pico-8 - Part 1

Saturday, November 2nd 2019, 7:08:51 pm

PicoBreed Breakdown - It’s full of stars

Saturday, November 2nd 2019, 7:44:04 pm