Log In  
Follow
asommer

Web developer, systems admin, network admin, fan of The Arsenal, and working on becoming a game developer using Pico-8 as a starting place.

Party On!


Remember That Movie From The 80s

Coming up with the title or this post made me remember that movie Enemy, Mine from the 80s. I think it was starring Dennis Quaid and Lewis Gossit Jr. They were enemies crash landed on a hostile deserted world and had to work together to survive. Then of course they become friends and have a bunch of adventures.

Interesting that they were both starship pilots and I'm working on a space shooter game... cause you know I liked them when I was a kid... in the 80s...

Making Sparks

To copy another element from Cave Berries, because I really like the way the laser sparks when it hits a wall, I added a sparks function/method to the [b]bulletconstruct

[ Continue Reading.. ]

0 comments



A Hit, A Hit, A Very Palpable Hit

We've got lasers firing and astroids asteroiding, or whatever it is they do, so now we need to be able to actually hit objects with our lasers. And the reverse, to know when an object has been hit by a laser, or another object for that matter.

Since starting this foray into game development I've continually been impressed about how supportive and helpful the Pico-8 community is. The forums have loads of great posts with comments that are usually helpful and questions ask to help someones understanding. Very fun to be a part of it in whatever small way I can.

Updating bullets

As the guide in Pico-8 Zine #3 teaches the bullets (lasers in this case) need to have a hitobx to determine when they collide with something. With the hero laser there are two "beams" so we'll need to add a hitbox for each one. Update the [b]bulletconstruct

[ Continue Reading.. ]

1
1 comment



Space Rocks

Adding asteroids to the mix seems like a good idea. They don't have bullets (hopefully) so they should be relatively easy to have float down the screen. Then again maybe they'll come into the the scene from any angle... haven't really decided on that part yet.

I think using the same type of object with an update method and an "array" of objects as we used with the bullets/lasers should work for asteroids too.

Creating Asteroids

Whip up a astroidconstruct function super similar to the bulletconstruct function:

asteroidconstruct = function()
  local obj = {}

  -- only come in from random top area.
  x = flr(rnd(127))

  -- set the direction randomly left, right, or center
  xs = {0, 1, 2}
  rnd_x = xs[flr(rnd(3)) + 1]
  if(rnd_x == 2)then rnd_x = -1 end
  text = rnd_x
  obj.dir = rnd_x

  obj.position = {x=x, y=0}
  -- obj.position = {x=52, y=52}
  obj.sprite = 17
  obj.update = function(this)
    this.position.y += 1
    this.position.x += obj.dir

    -- remove it when it goes off screen
    if(this.position.y>127)then del(asteroids, this)end
  end
  return obj
end

[ Continue Reading.. ]

0 comments



Refactor Fun

After reading more of the Pico-8 Zine 2 it's crazy obvious that I should use a "Finite State Machine" to control the hero ship, enemies, etc. I've been looking through the code of the iconic P.A.T. Shooter and it seems a state machine is used to keep track of everything.

It makes sense and it seems to allow for more "portable" functions. As in hey this function is great I can totally use it pretty much as is in a whole other project. Yay, me! Yay, us guys! (at least that's what I want to say)

Using init

The first thing to refactor, I guess, is the global variables declared at the top of the file. They can be blasted into the _init function and everything should work the same:

[ Continue Reading.. ]

2 comments



FIRE!!!

When I hear the word FIRE (all caps necessary) I always think of Captain Kirk at the end of Undiscovered Country:

And it's now time to make our hero ship fire it's own weapons. In this case we'll start with lasers and go from there. Thinking to have some type of bomb/missile to add a little extra kick to our plucky hero.

Plucky, ya definitely plucky!

Adding the Sprite

In this case the sprite is borrowed again from Cave Berries. Except the color is going to be changed up to green and dark_green.

I created a simple alternating green/dark_green pattern on the edge of the 8x8 sprite position. This will match up with the "top" of the hero ship's "laser pylons".

[h2][b]Finding Help

[ Continue Reading.. ]

0 comments



Cranked missiles up to 11, added shields, and life to the hero and still couldn't break 2000 points...

LOL

2 comments



Making Exhaust Look Good

Using a straight up sprite for an exhaust trail didn't look that cool to me. Similar space shooter games have different ways of animating fire/exhaust coming out of a ship, but I really like the "sparkly" effect in games like Cave Berries when the eye laser hits something.

Brief flashes of bright pixels are surprisingly satisfying...

Sidebar... a little Refactoring

Before we jump into exhaust awesomeness I want to send a big thanks to @morningtoast and @Connorses for some great feedback on my last post. morningtoast suggested to assign "attributes" to a Lua Table when it's declared very similar to JavaScript, Ruby, etc. So the hero statement becomes:

hero = {
  x = 58,
  y = 100,
  sprite = 0,
}

[ Continue Reading.. ]

0 comments



Movement

I learned how to move an "object"/"pixels" around the screen while working through the Pico-8 Zine paddle game example. It seems to work well and I was quickly able to move the paddle back and forth. Very satisfying.

While looking at the source of other games I noticed they used a pretty similar approach. One thing they did use that seems more segmented is to use Tables to create key/value pairs for attributes of an object.

Coming from web development this looks suspiciously like an object...

The Hero

In this case I created a hero table and set some starting attributes:

-- hero
hero = {}
hero.x = 58
hero.y = 100
hero.sprite = 0

So the hero will use sprite 0 and start at x 58 and y 100 which is the lower middle of the screen.

[h2][b]move_hero()

[ Continue Reading.. ]

1
3 comments



Discovery, or The Future is in the Past

For a few months I've been chewing on the idea of developing a 8 bit style game to run on Raspberry Pi alongside old ROMS from major game developers. I was thinking the idea was original, but after some reflection I realize I must have picked it up somewhere...

I ordered a C.H.I.P (well okay a couple of them) back in like November and read up on the PocketCHIP about the same time. While reading about PocketCHIP I read, and probably even watched some videos, about the Pico-8 fantasy console. I think that was my first exposure to Pico-8.

This is when I think I internalized the idea of a "brand new" pixelated "game engine" for developing games that run on low end hardware.

I am so glad that Zep and Lexaloffle did the hard work and developed such a cool platform for others to play in.

[h2]Learning Pico-8 Development

[ Continue Reading.. ]

6
2 comments