Final project proposal: The Good Vampire

The concept is that the player character is a young vampire trying to get by, so he feeds off of blood bags instead of people because murder is bad!

This is not entirely functional and posted for the sake of today’s class, there is a list at the bottom of the post of the things I intend to add after class.

The following are the sprites for the player character, the human “enemy” (it’s more like an obstacle), and the blood bag item, respectively.

The following are the screens that I made for the start menu, the instructions menu, and the gameplay environment.

Code: https://editor.p5js.org/robbiery/sketches/4QTAKAMGz

Here is a list of things I need to add before I can upload it to itch.io:

  • Scoring: Each blood bag will increase your score, but killing a human will give you a strike. There is no win condition, but if you kill 3 humans you lose.
  • A fail animation: a short gif of the player character getting arrested.
  • A sprite showing the blood bag is drained after collecting it, as well as a sprite for the player character like a smile, to indicate that the blood bag has been collected.
    • The blood bag is more important. It also needs to be smaller.
    • Similarly, there should also be a bloodied player character sprite to indicate the player has killed a human.
  • For logic purposes, editing the dead human sprite to show a person taking them away (because dead humans do not just glide down the street).
  • Lastly, sound effects if I can get to it.

p5.js blog post #9

The collisions in and of themselves were not the hard part, but figuring out how to remove the sprites from the canvas was difficult as there’s no easy way to remove preloaded images. I decided to make them slide out of the canvas, and it makes sense with the dead bodies (once I edit the sprite) but less sense with the blood bags.

Setup function code and collision code. Shows dead body sprite in preview.
Shows code for enemy object and the preview screen with the player, pick up item and enemy.

Code: https://editor.p5js.org/robbiery/sketches/by8eiuGLb

p5.js blog post #8

I made animations for the character’s movement each cardinal direction. The other image files are of a collectible item which increases the player’s score, an “enemy,” and a death state for the enemy. I only have the Player() object here as I want to set up the arrays before I tackle the enemies and the pick-up items.

Showing the code for the images used in the game.
Showing the code for animation within the Player() object, as well as demonstrating the animation.

Code: https://editor.p5js.org/robbiery/sketches/yeUtl4pJB

Final Scratch Project: Robot Rush

Link to my game!

Video demo of game:

I’m just going to ramble about my experience with this project. This has been a bit of a roller coaster of a project, purely because I’m much more used to text based coding and Scratch’s simplification with blocks means I need to find the specific block for my needs. It took much longer than necessary to find the block that would allow me to loop between a specific range of costumes. This code is infinitely more compact than what it used to be, which was spread across different sprites for different directions.

Screenshot of the code for movement animation.

Scratch is also odd in that because it’s not super robust compared to high level programming languages, some actions such as broadcasting messages take too long to occur and if things aren’t happening fast enough, it breaks the code. Then there’s comparisons, which is honestly really easy in text-based coding, not so much in Scratch. Sometimes, it does not do the comparison you expect it to do or doesn’t do it at all.

Screenshot of part of my code for the bullets. Includes a long comment on how it works.

There’s more I would like to add, like power-ups and an animated health bar but I think with a Scratch game, less is better. I like how clean my game came out, I’m not one to mess with something that works.