last modified July 20, 2020
Space ALien Invaders - Shoot laser beams to fend of the alien invasion. Move your space ship horizontally to avoid enemy attacks. Prevent the aliens and UFOs from descending to Earth. How high can you score in this fast-paced arcade game? Features: - Fast and endless gameplay - Intelligent enemies - Simple and intuitive controls. Play with keyboard, mouse, or touch controls on mobile - Retro. Ben Alien Force Java Games - Download with Nokia, Samsung, Motorola, LG, Sony Ericsson, Blackberry and for all other Java supported J2ME mobile phones. Game Java ALIEN - Download dengan Nokia, Samsung, Motorola, LG, Sony Ericsson, Blackberry dan untuk semua ponsel Java J2ME lainnya didukung.
Download Free Java Game Cowboys & Aliens File Title: Cowboys & Aliens File Type: Java Game Categories: Arcade & Action Resolution: 480 x 800 pixels File Size: 3.4 MB Posted On: 09 Nov, 2020 Cowboys & Aliens Java Game Description. Simple computer game for shooting aliens using the Processing language.
In this part of the Java 2D games tutorial we will create a simpleSpace Invaders game clone in Java. Source code and images can be found at the author's Github Java-Space-Invaders repository.
Space Invaders is an arcade video game designed by Tomohiro Nishikado.It was first released in 1978.
In Space Invaders game, the player controls a cannon. He is aboutto save the Earth from invasion of evil space invaders.
In our Java clone we have 24 invaders. These aliens heavily shell the ground.When the player shoots a missile, he can shoot another one only when it hitsan alien or the top of the Board. The player shoots with the Space key. Alienslaunch randomly their bombs. Each alien shoots a bombonly after the previous one hits the bottom.
This is the main class. It sets up the application.
Commons.java file has some common constants. Theyare self-explanatory.
This is the
Alien sprite. Each alien has an inner
act() method is called from the
Board class.It is used to position an alien in horizontal direction.
getBomb() method is called when the alien is about todrop a bomb.
This is the
Player sprite. We control the cannon withthe cursor keys.
These are the initial coordinates of the player sprite.
If we press the left cursor key, the
dx variable is set to -2. Nexttime the
act() method is called, the player moves to the left.
If we release the left or the right cursor, the
dx variable isset to zero. The player sprite stops moving.
This is the
Shot sprite. The shot is triggered with theSpace key. The
H_SPACE and the
V_SPACEconstants are used to position the missile appropriately.
This is the basic
Sprite class. Other sprites inherit from it. Ithas some common functionality.
The main logic of the game is located in the
gameInit() method we create 24 aliens. The alien imagesize is 12x12px. We put 6px space among the aliens. We also create the playerand the shot objects.
drawBombing() method draws bombs launched by the aliens.
doDrawing() method, we draw the ground, the aliens, the player,the shot, and the bombs.
update() method we check the number of destroyedaliens. If we destroy all aliens, we win the game.
If the shot triggered by the player collides with an alien, the alien ship isdestroyed. More precisely, the dying flag is set. We use it to display an explosion.The deaths variable increases and the shot sprite is destroyed.
If the aliens reach the right end of the
Board, they move down and changetheir direction to the left.
This code moves aliens. If they reach the bottom, the invasion begins.
This is the code that determines whether the alien will drop a bomb. The alienmust not be destroyed; i.e. he must be visible. The bomb's destroyed flag mustbe set. In other words, it is the alien's first bomb dropping or the previous droppedbomb already hit the ground. If these two conditions are fulfilled, the bombingis left to the chance.
If the bomb is not destroyed, it goes 1 px to the ground. If it hits the bottom,the destroyed flag is set. The alien is now ready to drop another bomb.
The actual processing of this particular
KeyEvent is delegated to the player sprite.
In this part of the Java games tutorial, we have created Space Invaders. Latex in word 2007.