The project structure
Create an empty Opa project with the opa create opacman
command. We need to modify the project structure. Let's first have a look at the modified project structure of our Pacman game:
The following is a brief description of the project files:
src
: The source code,ghost.opa
andpacman.opa
define the type of ghost and Pacman,render.opa
takes charge of drawing on the canvas, andgame.opa
contains the game logicresources
: This folder contains the required resources, including images, sounds, and stylesresources/js
:Preloadjs.min.js
andsoundjs.min.js
are two open source JavaScript libraries and are used to preload game resources and to play soundsplugins
:Preloader.js
is a plugin that we write to load game resources.We need to rewrite the
opa.conf
file to include the source code in thesrc
directory:opacman.game
has the following files:src/game.opa
src/ghost.opa
src/pacman.opa
src/render.opa
We need to modify Makefile
to remove database support as we do not need...