{"id":15925074,"url":"https://github.com/songkeys/pacman","last_synced_at":"2025-08-15T20:31:19.134Z","repository":{"id":45163518,"uuid":"163447104","full_name":"songkeys/pacman","owner":"songkeys","description":"A Pᗣᗧ•••MᗣN game written in Java/JavaFX with over-commented JavaDoc.","archived":false,"fork":false,"pushed_at":"2022-01-04T13:08:10.000Z","size":2549,"stargazers_count":3,"open_issues_count":0,"forks_count":2,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-08-11T02:48:55.859Z","etag":null,"topics":["game","java","javafx","maven","mvc","pacman","singleton"],"latest_commit_sha":null,"homepage":"https://songkeys.github.io/pacman","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/songkeys.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-12-28T20:31:06.000Z","updated_at":"2024-07-02T05:13:28.000Z","dependencies_parsed_at":"2022-08-26T06:12:45.463Z","dependency_job_id":null,"html_url":"https://github.com/songkeys/pacman","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/songkeys/pacman","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/songkeys%2Fpacman","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/songkeys%2Fpacman/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/songkeys%2Fpacman/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/songkeys%2Fpacman/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/songkeys","download_url":"https://codeload.github.com/songkeys/pacman/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/songkeys%2Fpacman/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":270624874,"owners_count":24618269,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-08-15T02:00:12.559Z","response_time":110,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["game","java","javafx","maven","mvc","pacman","singleton"],"created_at":"2024-10-06T21:41:50.777Z","updated_at":"2025-08-15T20:31:18.724Z","avatar_url":"https://github.com/songkeys.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# \u003cimg src=\"https://i.loli.net/2018/12/14/5c13bf0563d18.gif\" alt=\"pacman logo\" width=\"50\"/\u003e Pacman\n\n[![](https://img.shields.io/github/license/Songkeys/pacman.svg)](https://github.com/Songkeys/pacman) [![](https://img.shields.io/badge/GitHub-pacman-blue.svg)](https://github.com/Songkeys/pacman) [![](https://img.shields.io/badge/GitLab-pacman-orange.svg)](https://projects.cs.nott.ac.uk/psysz4/pacman)\n\n[English](README.md) | [简体中文](README.zh-cn.md)\n\n\u003e This is a pacman game project written in JavaFX for *[G52SWM CW2](https://projects.cs.nott.ac.uk/psysz4/swm)*, using some design patterns like MVC, Singleton and Factory, etc.\n\n## Content\n\n- [Screenshots](#screenshots)\n- [Prerequisite](#prerequisite)\n- [Compiling \u0026 Running](#compiling-running)\n- [Source File Structure](#source-file-structure)\n- [Creating New Levels](#creating-new-levels)\n- [File Storage](#file-storage)\n- [Design Parterns](#design-parterns)\n- [About G52SWM CW2](#about-g52swm-cw2)\n- [Credits](#credits)\n\n## Screenshots\n\n![screenshots.jpg](https://i.loli.net/2018/12/29/5c266b2ff35e1.jpg)\n\n## Prerequisite\n\n- Java 10\n\n\u003e Compatible with:\n\u003e\n\u003e - Java 11\n\u003e - Maven\n\u003e\n\u003e *(Since [JavaFX 11](https://openjfx.io/index.html) is dropped from Java 11, you would need [Maven](https://maven.apache.org/) installed to get the required sources if you use Java 11.)*\n\n## Compiling \u0026 Running\n\nYou can launch the app either by running that `pacman.Main.main()` method inside your IDE, or type `mvn clean compile package exec:java` on the command line if you have maven installed.\n\nFor example, in IntelliJ, Click \u003ckbd\u003eRun\u003c/kbd\u003e  -\u003e \u003ckbd\u003eRun 'Main()'\u003c/kbd\u003e.\n\n## Source File Structure\n\n```\nsrc\n└── main\n    ├── java\n    |   └── pacman\n    |       ├── constant\n    |       ├── controller\n    |       ├── model\n    |       ├── util\n    |       └── Main.java\n    └── resources\n        └── pacman\n            ├── css\n            ├── image\n            ├── map\n            ├── music\n            └── view\n```\n\n## Creating New Levels\n\nA new level can be easily added by creating a new ASCII `.txt` file under `/src/main/resources/pacman/map`.\n\n### Step 1: Creating the ASCII file\n\nHere is an example file `example.txt` defining the initial state of a level:\n\n```\n/* This is a comment line. */\n@PACMAN_PADDING_RATE 0.1\n@PACMAN_STEP_RATE 0.15\n@GHOST_PADDING_RATE 0.15\n@GHOST_STEP_RATE 0.18\n@COOKIE_PADDING_RATE 0.5\n\n#########################\n#@....#...........#....o#\n#.###.#.#########.#.###.#\n#.#O.................O#.#\n#.#.###.###   ###.###.#.#\n#.#.....#     X #.....#.#\n\u003c...###.#       #.###...\u003e\n#.#.....# X X X #.....#.#\n#.#.###.#########.###.#.#\n#.#O.................O#.#\n#.###.#.#########.#.###.#\n#o....#...........#....o#\n#########################\n```\n\n#### Symbols\n\n|  Symbol   |             Model              |\n| :-------: | :----------------------------: |\n|    `#`    |          An obstacle.          |\n|    `@`    |          The pacman.           |\n|    `.`    | A small cookie for `1` score.  |\n|    `o`    | A medium cookie for `5` score. |\n|    `O`    |  A big cookie for `10` score.  |\n|    `X`    |            A ghost.            |\n| `\u003c` \u0026 `\u003e` |          The portals.          |\n|    ` `    |         An open space.         |\n\n\u003e Note that neither of portals should be missing when the other twin is defined.\n\n#### Configurations\n\n|          Key           |                    Value                     |\n| :--------------------: | :------------------------------------------: |\n| `@PACMAN_PADDING_RATE` | The rate of pacman's padding. Default: `0.1` |\n|  `@PACMAN_STEP_RATE`   |  The rate of pacman's step. Default: `0.1`   |\n| `@GHOST_PADDING_RATE`  | The rate of ghosts' padding. Default: `0.2`  |\n|   `@GHOST_STEP_RATE`   |   The rate of ghosts' step. Default: `0.1`   |\n| `@COOKIE_PADDING_RATE` | The rate of cookies' padding. Default: `0.3` |\n\n\u003e A padding defines the acceptable area of overlapping when two models touch.\n\u003e\n\u003e A step defines how fast a movable model can move.\n\n### Step 2: Adding the Filename to Constants\n\nIn `src/main/java/pacman/constant/FileName.java`, add the filename of the map we created in step 1 to `MAPS`:\n\n```java\n  public static final Set\u003cString\u003e MAPS =\n      new TreeSet\u003c\u003e(\n          Arrays.asList(\n              \"pacman/map/#001 So Easy.txt\",\n              \"pacman/map/#002 Easy Again?.txt\",\n              \"pacman/map/#003 A Traitor.txt\",\n              \"pacman/map/#004 Freedom.txt\",\n              \"pacman/map/#005 Less is More.txt\",\n              \"pacman/map/#006 Up and Down.txt\",\n              \"pacman/map/#007 One Way.txt\",\n              \"pacman/map/#008 The Maze.txt\",\n              \"pacman/map/#009 Accel World.txt\",\n              \"pacman/map/#010 Spires.txt\",\n              \"pacman/map/example.txt\"));\n```\n\nDone! A new level is created.\n\n## File Storage\n\nThis project stores scoreboards in user's home directory: `~/.pacman`.\n\nFeel free to delete it when you don't need mess up with this game any more.\n\n## Design Parterns\n\n- MVC\n- Singleton\n- Factory\n- Builder\n\n## About G52SWM CW2\n\nClick [here](https://projects.cs.nott.ac.uk/psysz4/swm) to know more about its requirements.\n\nMy final submission for the coursework is tagged as `1.0`.\n\n### Class Diagram\n\n![](https://ws4.sinaimg.cn/large/006tNbRwgy1fyn2czxz5qj314y0u0k1y.jpg)\n\n### Video in Action\n\nhttps://youtu.be/U7muRCK_orU\n\n## Credits\n\nThis project is modified from a basic [one](https://projects.cs.nott.ac.uk/psysz4/swm).\n\nAll media assets (images \u0026 music) are derived from the internet, and are ensured to be free to use for non-commercial use.\n\nThis project adopts MIT license.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsongkeys%2Fpacman","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsongkeys%2Fpacman","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsongkeys%2Fpacman/lists"}