Git Product home page Git Product logo

pacman's Introduction

Pacman

An OOP implementation of Pacman in Excel

This is very much a WIP. Some explaination of the code and architecture can be found here for now.

Right now, until I've got a fully working game, the develop branch is default.

Get Started

You should be able to simply clone and launch the Pacman.xlsm. Sheet1 has a "hardcoded" maze. Eventually, I'd like to teach excel how to draw a maze from scratch. You can start a game by running Client.Prototype(). As of now, the only things that work are:

  1. You can move pacman by using the arrow keys
  2. Ghosts will navigate themselves around the maze

For now, you can't die, but you also can't eat!

Rubberduck

Its really helpful to have the Rubberduck VBE Add-in installed. You will be able to see a nicer folder structure for the project.

Disclaimers

  • I have only ever run this on my machine. I don't know how well things like resolution and game ticking speed will work on your machine.
  • It definitely won't work on macOS
  • I have experienced some really nasty crashes while trying new things in development. Crashes that completely broke the vbproject.bin. Here are some things that seem to cause crash issues:
    1. Using custom collections with enumerators
    2. Having the MapManager load its own map file. (if the controller does this, it seems to not crash???)

pacman's People

Contributors

archerbird avatar

Stargazers

 avatar  avatar Evgenii avatar jimmyhu avatar  avatar  avatar Brett Shepard avatar Mathieu Guindon avatar  avatar

Watchers

 avatar Mathieu Guindon avatar  avatar  avatar  avatar

pacman's Issues

Map/Maze

So this is in a very messy state right now. A map is simply a 2D Array of Tiles. The idea here was to mimic the Excel.Range.Value array, where you can access tiles from the map like Map(row,column). I have a module called MapManager acting as a global static class that the controller and models can all call on. I'm thinking this should maybe just become a class though.

For now, I've encoded the maze as a series of characters in a .pmap file that can be easily read and converted into a 2D array of Tiles. One icky issue with my encoding is that it is technically not quite to-scale with the original pacman game. I have put a spacer tile between each pellet on the map, which effectively means that my tiles are equal to ~1.6 original pacman tiles. The problem I have with this is that the map string representation can't really be used for every view implementation. Ideally, we would have a correctly scaled map encoding, and the excel view, if we want to keep the way it looks now, would have to have some sort of scaling logic.

Ghost navigation

Ghosts have three navigation behaviors during a game:

  1. Scatter
    Each ghost targets a tile in the corner of the map. Ghosts begin in this mode and switch between scatter and chase after a specified amount of time.
  2. Chase
    Each ghost has a different strategy for choosing its target tile. All chase strategies depend, in some way, on Pacman's position and heading.
  3. Frightened
    This navigation mode is triggered by pacman eating a super pellet. Ghosts move at random in this mode and at have the normal speed.

General Rules

  • Ghosts may not choose to reverse direction
  • Ghosts are forced to reverse direction after a behavior state change.

[More details] (https://gameinternals.com/understanding-pac-man-ghost-behavior)

Helping out

Hey, very out of the blue: I really like your project, it seems big but not huge, really clean so far, fun concept. I was wondering if there's any way I could could contribute or help out?

I've never done the MVP pattern before but I want to, and I've been trying recently to get to grips with source control, but it seems too easy when you're the only one working on a project! Take a look at my github or Code Review to get an idea of stuff I've done - I'd say my recent post on asynchronous timers is most representative of my style (incidentally, I do think you should take a look at implementing an asynchronous game loop, get rid of that nasty DoEvents stuff in the Tick function. Especially if you want to add flashing animations and stuff;)

Anyway, lmk if you'd be at all interested in this, I know it's out of the blue and you are probably doing this project to learn some techniques yourself, so possibly you don't want anyone else looking at it, I'd understand:) But personally I see an opportunity to work on an interesting project like this one and also get some experience with github perhaps, so if there are any bits and pieces I could work on then I'd love to help out!

Greedo

Game Piece Interactions

We need to implement a way for game pieces to interact with pacman when they share the same tile as their IGamePiece.CurrentTile

Off the top of my head:

  • Pellets should be eaten and disappear from the view. Score should be incremented. Any game rules that depend on remaining pellets should be triggered
  • Ghosts in Scatter or Chase mode should kill pacman
  • Ghosts in Frightened mode should die and travel back to the ghost house for respawn
  • Super Pellets should be eaten and trigger frightened mode.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.