Computer Game Design and Development Using Java
Computer Game Design and Development Using Java
By
Game Design
It is the entire process of creating a game idea, from research to the graphical interface to
the unit’s capabilities.
It is the process of creating and defining games.
3. GAME STORY
Around 2049 A.D., aliens arrived at our planet, and they were not peaceful. They have
destroyed two of the major cities in the world and are now threatening to destroy more. The United
Defense Force has decided to send their special agent, Juan Matapang to destroy the alien force
with the new experimental ship: ZS 3020 Airborne. You play the role of Juan. Your mission: To
destroy all the alien scum.
2
5. MENUS
When the game starts, the user is presented with the main menu—in this menu he has five
options.
1. Start New Game
This option starts a new game. The player is sent to the new game menu where he can
enter his name and chose the game difficulty.
2. Continue Previously Saved Game
This option starts a game that was previously saved. The player is sent to the load game
menu where he can choose a game from a list of previous saved games.
3. See Table of High Scores
This option shows the high scores table.
4. Options
This option shows the Options menu. The player is sent to the Options menu where he can
change the graphics, sound, and control settings.
5. Exit
This option exits the game.
6. PLAYING A GAME
When the game starts, a company splash screen is shown for three seconds. After the three
seconds the screen fades to black and a splash screen starts to fade in. After four seconds the
screen re-fades to black and the player is sent to the main menu. When the player starts a new
game, he is presented with a new menu screen where he can enter his name, and choose the game
difficulty. After this is done, the user is sent to the game itself.
When each level starts, there is a three-second countdown for the game to start. The player
can move his ship to the left or right and shoot using the controls defined in the Options menu. When
all the enemies are destroyed, the player advances a level. When the player is shot by an alien, he
loses a life. If the player loses all the lives, the game ends. If the aliens reach the bottom of the
screen, the game is also over.
If the player presses the Escape key while playing, the game is paused and a dialog appears
asking what the user wants to do, and he can choose from the options:
Normal Ships
Normal ships are the typical enemies of the player. They can have various images but their
functionality is the same. They move left and right and randomly shoot bullets to the player vertically.
When the ships reach a vertical margin, they move down a bit. These ships are destroyed with a
single shot and each ship destroyed gives one hundred points to the player. As the levels progress,
the faster the ships move.
3
Bonus Ships
Bonus ships show randomly on the top of the screen. They move horizontally and very quickly.
These ships exist only to give bonus points to the player and don’t affect the gameplay since they
don’t shoot at the player and are not required to be destroyed. When a bonus ship is destroyed, the
game awards 500 points to the player.
CONCEPTUAL FRAMEWORK
4
ELEMENTS OF COMPUTER GAME
1. Graphics
2D
3D
Resolution measured in pixels of width and height.
2. Animation
Sprite Animation
3. Sound Effects
4. Background Music
5. Collision Detection
SPRITE
Sprites are the characters in your game. A moving object in the display. A sprite has solid
pixels that show the shape the object and transparent pixels that are hidden so that it will not
block the background.
5
ANIMATION
Animation is where the action is. To add action to a game, you make a sprite move around
the screen and do interesting things. Animation is the product of showing a sequence of frames,
with each frame representing the next increment of motion in the sequence. The motion is an
illusion. Nothing really moves. Every picture that we see is a still frame. But when the frames are
shown in rapid succession, our brains are tricked into thinking that we are seeing motion.
Background Sprite
Fast
transfers
6
AREA INTERSECTION-RECTANGLE PIXEL-BASED COLLISION DETECTION ALGORITHM
Invented by John B. Lacea
Sprite #1
Sprite #2
Sprite #1
(StartX2 + Width, StartY2 + Height)
7
GAME PROGRAMMER NEEDS TO BE AWARE THAT
1. Drawing bitmaps and sprites consume a large amount of memory RAM.
2. Sound effects and music consume a large amount of memory RAM.
3. Higher graphics resolution slows down the CPU’s processing.
4. More bitmaps and sprites to draw on screen slow down the CPU’ processing.
5. More collision tests slow down the CPU’s processing.
8
Pricing:
Free for personal use, beginners and students (cannot be used by developers whose
revenue or money raised (ie: from Kickstarter) is over $100k)
Unity Plus: $35/month (cannot be used by developers whose revenue or money raised is
over $200k)
Unity Pro: $125/month
Features:
Editor that supports both 2D and 3D, AI pathfinding tools, UI creator, physics engine and
can be customized with plugins and assets from Unity’s asset store
Art and design tools including a timeline tool for cutscenes, camera control, post processing
effects like color grading, animation tools, level design and lighting tools
Graphics rendering
The ability to develop across platforms, including the Nintendo Switch, Sony PlayStation 4,
Xbox One and Oculus Rift
Unity asset store with environments, characters and other models
Multiplayer capabilities
Team collaboration tools
Built-in live-ops analytics
Monetization features
Pricing:
Free to use, but you will have to pay a 5 percent royalty after the first $3,000 in revenue
you make per product, per quarter
Features:
Real-time rendering
C++ source code
Blueprints to code without using code
Multiplayer
VFX and particle systems
Post-process effects
Material editor
Animation tools
Cinematic tools for cutscenes
VR, AR, and XR development tools
Terrain and foliage tools for open worlds
AI engine
Audio engine
Asset marketplace
Modular plugins
9
Pricing:
Pay what you want, royalty-free, but you can allocate money to the Indie Development
Fund to help support indie developers creating games with CryEngine
Features:
Physically based rendering
Real-time dynamic water caustics
Tessellation
Efficient Anti-Aliasing
Real-time local reflections
Lighting tools
Particle system and volumetric fog shadows
Material editor
Level design
Trackview cinematic editor
Flowgraph
Designer tool
Animation tools
Character creation and customization
Advanced AI system
Multi-platform support
Audio editors
Physics engine
Pricing:
Creator version: $39
Developer version: $99 with ability to publish to PCs, $149 with ability to publish to Amazon
Fire or HTML5, $399 with ability to publish to mobile and Microsoft devices such as Xbox
One
Creators Portal
Console version: $399 with ability to publish to Xbox One Creators Portal, $799 12-month
license to publish to PlayStation 4 or Xbox One, $1500 12-month license to publish to all
platforms
Features:
Laptop mode
Customizable game development environment skins
Drag-and-drop workflow
Code library of events and actions
Code preview
GameMaker Language for coding
Object layers
Tile brushes
Brush-based editing
Animation support
Debugger
Monetization
Sound mixing
10
Push notifications
Extensions
Marketplace
Pricing:
Free
Features:
Multi-platform 2D and 3D open source game engine.
Pricing:
Free
Features:
Open-source implementation of the Microsoft XNA 4 Framework.
Pricing:
Free
Features:
High performance realtime 3D rendering using Direct3D and OpenGL,
Platform independent. Runs on Windows, Linux, OSX, Solaris, and others.
Huge built-in and extensible material library with vertex, pixel, and geometry shader
support.
Seamless indoor and outdoor mixing through highly customizeable scene management.
Character animation system with skeletal and morph target animation.
Particle effects, billboards, light maps, environment mapping, stencil buffer shadows, and
lots of other special effects.
Several language bindings which make the engine available to other languages such as
C#, VisualBasic, Delphi, Java …
Two platform and driver independent fast software renderers included. They have different
properties (speed vs. quality) and feature everything needed: perspective correct texture
mapping, bilinear filtering, sub pixel correctness, z-buffer, gouraud shading, alpha-blending
and transparency, fast 2D drawing, and more.
Powerful, customizeable, and easy to use 2D GUI System with Buttons, Lists, Edit boxes,
2D drawing functions like alpha blending, color key based blitting, font drawing, and mixing
3D with 2D graphics.
Clean, easy to understand, and well documented API with lots of examples and tutorials.
Written in pure C++ and totally object oriented.
Direct import of common mesh file formats: Maya (.obj), 3DStudio (.3ds), COLLADA (.dae),
Blitz3D (.b3d), Milkshape (.ms3d), Quake 3 levels (.bsp), Quake2 models (.md2), Microsoft
DirectX (.X)…
Direct import of Textures: Windows Bitmap (.bmp), Portable Network Graphics (.png),
Adobe Photoshop (.psd), JPEG File Interchange Format (.jpg), Truevision Targa (.tga),
ZSoft Painbrush (.pcx)…
Fast and easy collision detection and response.
Optimized fast 3D math and container template libraries.
Directly reading from (compressed) archives. (.zip, .pak, .pk3, .npk)
Integrated fast XML parser.
Unicode support for easy localisation.
11
Works with Microsoft VisualStudio, Metrowerks Codewarrior, Bloodshed Dev-C++,
Code::Blocks, XCode, and gcc 3.x-4.x.
The engine is open source and totally free. You can debug it, fix bugs and even change
things you do not like. And you do not have to publish your changes: The engine is licensed
under the zlib licence, not the GPL or the LGPL.
1. Image
This class is used to load images.
2. Media
This class is used to represent a media resource.
3. MediaPlayer
This class provides the controls for playing media.
4. Pane
This class provides layout of text, image, GUI, etc. as layers.
5. start( ) method
The main entry point for all JavaFX applications. The start method is called after the init
method has returned, and after the system is ready for the application to begin running.
6. GameLoop( ) method
This method is called in the start( ) method and makes the CPU executes the codes
repeatedly until the user closes the application.
3. On the Open Project Dialog Window, browse the location path and folder c:\IT Week 2019\Computer
Game Design and Development\Space Invaders and select the folder name with a coffee picture
beside and then click Open Project.
4. Press F6 to Run the executable JAR file
5. Close the game when you are done and please run and test my 3D C/C++ Game with Irrlicht
Engine. It is located at the path and folder c:\IT Week 2019\Computer Game Design and
Development using Java\C++ 3D and run the filename Lacea 3D Avatar.exe
12
“Try to learn something about everything and everything
about something.”
Thomas Henry Huxley
“I do not know anything, but I do know that everything is
interesting if you go into it deeply enough.”
Richard Feynman
“Example is the school of mankind, and they will learn at
no other.”
Edmund Burke
“Share your knowledge. It’s a way to achieve immortality.”
Dalai Lama
“It does not make much difference what a person studies.
All knowledge is related, and the man who studies
anything, if he keeps at it, will become learned.”
Hypatia
“Mathematics possesses not only the truth, but some
supreme beauty – a beauty cold and austere, like that of
a sculpture.”
Bertrand Russell
“Imagination is much more important than knowledge
because knowledge describes what we know. Imagination
describes everything that we can potentially know in the
future.”
Albert Einstein
13