Log In  


Cart #55678 | 2018-08-25 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA
11


What is this?

I plan to create a shmup for Pico-8, but I wanted an easy way to test different attack patterns. This started off as a simple toy to test creating a circle of bullets and expanded into a tool to play with several different variables in order to fine tune attacks.

What can I do with it?

  • Use the up and down arrow keys to navigate the menu. On each menu item press left and right to change the value.

Alt Text

  • Press Z to hide the UI. While hidden, you can use the arrows to move the bullet pattern's origin point.
  • Press X to reset the values to defaults.

Loop On

This changes which frame bullets/bullet waves are created. Basically, how often they appear.

Alt Text

Cluster Count

This affects how many bullets appear per wave. This is only enabled for the "arc" and "radial" pattern types.

Alt Text

Pulse

Defaults to 0. When greater than 0, it will create bullets for X frames, and then pause for X frames.

Alt Text

Rotate

Defaults to 0. When greater than 0, it will rotate the bullets clockwise, less than zero, counter-clockwise.

Alt Text

Bullet Type

Square, Circle, or 3 Different Sprites

Alt Text

Pattern

Cycle through all bullet pattern types: Single, Cross, Spreadshot, Arc, Semi-Circle, and Radial

Alt Text

So check out this code to learn or just load up the cart and play around!

Alt Text
Alt Text

I would love any feedback on my first cart submission. Code on Github: https://github.com/rustybailey/bullet_pattern_tester

11


Nice toolkit -
Couple of comments:

  • add/del is not consistent. Make_bullet should add it to the set as ‘update’ removes it
  • draw uses a global bullet type value :/
  • thou shall not use for/all but for/i or for/pairs (way faster)
  • there is no provision for collision detection. Ideally each bullet should have a direction vector and position of the previous frame. Collision detection itself can then be delegated to a user supplied function.

@freds72

> add/del is not consistent. Make_bullet should add it to the set as ‘update’ removes it
Interesting. Where should I be calling add()?

> draw uses a global bullet type value
Good callout. This was one of the last features I added so I was just trying to get it done at that point. :/

> thou shall not use for/all but for/i or for/pairs (way faster)
Good to know! Thanks.

> there is no provision for collision detection. Ideally each bullet should have a direction vector and position of the previous frame. Collision detection itself can then be delegated to a user supplied function.
Can you explain this a bit more? I definitely didn't address collision detection at all in this tool, but I'm not sure what the thing you're explaining would do.


Simple, make bullet should simply add the bullet to the bullet set!!

function make_bullet()
 -- yada yada
 return add(bullets, bullet)
end

For collision, it is usually required:

  • to have velocity vector (for separation)
  • to have previous position to support fast intersection (e.g. bullets moving faster than their own radius!)
    (or a mix of position+velocity+velocity vector)

Ah ok, I see what you mean with the add() thing.

Re: collision. I think I understand conceptually what you are saying, but I am not sure how I would implement it (incredibly new to game dev). Do you have or know of an example of this I could look at?


Updated to v2. Main improvements:

  • Add more stats
  • Add rotation
  • Add arc pattern
  • Add 2 new sprites
  • Press Z to hide menu
    • When hidden, you can move the bullet origin
  • Press X to reset values
  • Refactor and comment so the code is more reusable

Marvelous !

Please add a RESET button so shots are facing down as they do initially, it's difficult to get back in a perfect position once you've rotated the cannon.


@dw817
You can press X to reset all values back to defaults.


Ah ! I didn't see that. Trying again. Ok, how about adding a horizontal line (shoots up and down) and a plus (shoots up, left, right, down).

You already have the T to shoot in 3-different directions, these would add 2-ways and 4-ways.


@dw817

You can actually already achieve that with the Radial pattern! :)
Boot up the cart, switch the pattern to Radial and then change the Cluster Count to 2 or 4.


Omy, never tried CLUSTER. Look at the lovely patterns. Welp, that's it.

This may not be the best shooter game I've played :) but it sure is the best engine to demonstrate complex movements I've seen so far that would be awesome for a great shooter. And it's really pretty to watch !

Nicely done, 💜Favorited!



[Please log in to post a comment]