Posts

Showing posts from May, 2018
Image
Space Intruders Game In Java Game Source code and the file is given below :  NOTE: Better to open the file in Netbeans  IDE. Download the file from HERE Comment below for any queries or suggestion  Thanks
Image
Flappy Bird Game In Java How to make Flappy Bird game in java? Create two new class and name it "FlappyBird" and "Renderer" as shown below Source Code For "FlappyBird" class is given below: import java.awt.Color ; import java.awt.Font ; import java.awt.Graphics ; import java.awt.Rectangle ; import java.awt.event.ActionEvent ; import java.awt.event.ActionListener ; import java.awt.event.KeyEvent ; import java.awt.event.KeyListener ; import java.awt.event.MouseEvent ; import java.awt.event.MouseListener ; import java.util.ArrayList ; import java.util.Random ; import javax.swing.JFrame ; import javax.swing.Timer ; public class FlappyBird implements ActionListener , MouseListener , KeyListener { public static FlappyBird flappyBird ; public final int WIDTH = 800 , HEIGHT = 800 ; public Renderer renderer ; public Rectangle bird ; public ArrayList<Rectangle> columns ; public int ticks , yMotion , score ;...

Brick Breaker Game in JAVA

Image
Brick Breaker Game in JAVA How to make a BrickBreaker game? 1. Create a new project and name it BrickBreaker and paste the source code which is given below. import javax.swing.JFrame; public class BrickBreaker { public static void main(String[] args) { JFrame obj = new JFrame(); Gameplay gameplay = new Gameplay(); obj.setBounds(10,10,700,600); obj.setTitle("BrickBreaker"); obj.setResizable(false); obj.setVisible(true); obj.setDefaultCloseOperation(JFrame. EXIT_ON_CLOSE ); obj.add(gameplay); } } 2. Creat new class two new class and name it "Gameplay" & "MapGentrator" as shown below After creating these class paste source code which is given below respectively. For Gameplay class. import javax.swing.JPanel; import javax.swing.Timer; import java.awt.Graphics2D; import java.awt.Rectangle; import java.awt.Graphics; import java.awt.Color...
Image
Snake Game in JAVA How to make Snake Game in java? 1. Download the following asset for the game Download →  Asset These files will be used in the game. After download, this file extract it to the specific folder and copy the files and paste it into your project as shown below 2. Create New Project and name it Snake Game and paste the source code which is given below import javax.swing.JFrame ; import java.awt.Color; public class SnakeGame { public static void main(String[] args) { JFrame obj = new JFrame(); Gameplay gameplay = new Gameplay(); obj.setBounds(10,10,905,700); obj.setBackground(Color. DARK_GRAY ); obj.setResizable(false); obj.setVisible(true); obj.setDefaultCloseOperation(JFrame. EXIT_ON_CLOSE ); obj.add(gameplay); } } 3. Create another class and name it Gameplay as shown below then paste the source code in "Gameplay" class which is given below import j...