A mini game made in java using zen graphics

Assignment Help JAVA Programming
Reference no: EM13162851

a mini game made in Java using Zen graphics . 

1. An option to fix the numbers for how they always fall vertically and don't reset back to the top if they fall past the bottom of the screen

2. Flicker fix if possible using use Zen.flipBuffer

3. Making the game die with an exception if possible

4. Making game harder over time in no errors

5. Visual distractions if possible

6. Option to skip easier levels

 

 

public static void main(String[] args) {

int x=0, y=0, dx=0, dy=0, score = 0;

String text = "";

long startTime =System.currentTimeMillis();

Zen.setFont("Helvetica-33");

while (Zen.isRunning()) {

 

if (text.length() == 0) {

x = 0;

y = Zen.getZenHeight() / 2;

dx = 2;

dy = 0;

text = "" + (int) (Math.random() * 999);

long elapsed = System.currentTimeMillis() - startTime;

startTime = System.currentTimeMillis();

score += 3000 / elapsed;

}

Zen.setColor(255, 0, 255);

Zen.fillRect(0, 0, Zen.getZenWidth(), Zen.getZenHeight());

 

Zen.setColor(0, 255, 0);

Zen.drawText(text, x, y);

Zen.drawText("Level: 0",10,30);

Zen.drawText("Score: 0",10,60);

x += dx;

y += dy;

// Find out what keys the user has been pressing.

String user = Zen.getEditText();

// Reset the keyboard input to an empty string

// So next iteration we will only get the most recently pressed keys.

Zen.setEditText("");

for(int i=0;i < user.length();i++) {

char c = user.charAt(i);

if(c == text.charAt(0))

text = text.substring(1,text.length()); // all except first character

}

Zen.sleep(90);// sleep for 90 milliseconds

 

}

}

 

}

Reference no: EM13162851

Questions Cloud

Calculate the partial pressure of sulfur dioxide : Calculate the partial pressure of SO2. Calculate the partial pressure of Cl2. Calculate the equilibrium constant at this temperature.
Compute and plot 4 mean temperature profiles : Generate by measdata.m an array A withsize (365,24), containing temperature measurements for an entire year [1 January,..., 31 December], 24 hours a day [00.00h,...,23.00h].
What is generational cohort-segmentation process : What is generational cohort? how would you use the concept in segmentation process? Define and give examples?
Analyze initial response to hart-rudman proposal prior : Analyze the initial response to the Hart-Rudman proposal prior to September 11, 2001, and what the Bush Administration did to increase the Homeland Security posture.
A mini game made in java using zen graphics : a mini game made in Java using Zen graphics .
What are your thoughts on introducing innovation : What are your thoughts on introducing innovation into the framework and industry dynamics change and new technology is introduced that could create quality improvements or efficiency if the current framework is enhanced.
Explain efficient nuclear power plant : If your electricity comes from a 33% efficient nuclear power plant, how many Pu-239 nuclei are produced as a result of your leaving the light on?
History of intelligence : After reviewing the history of intelligence, what events have had a profound impact on U.S. intelligence today?
State gas is added with no change in volume : If 0.130 mol a third gas is added with no change in volume or temperature, what will the total pressure become?

Reviews

Write a Review

JAVA Programming Questions & Answers

  Recursive factorial program

Write a class Array that encapsulates an array and provides bounds-checked access. Create a recursive factorial program that prompts the user for an integer N and writes out a series of equations representing the calculation of N!.

  Hunt the wumpus game

Reprot on Hunt the Wumpus Game has Source Code listing, screen captures and UML design here and also, may include Javadoc source here.

  Create a gui interface

Create GUI Interface in java programing with these function: Sort by last name and print all employees info, Sort by job title and print all employees info, Sort by weekly salary and print all employees info, search by job title and print that emp..

  Plot pois on a graph

Write a JAVA program that would get the locations of all the POIs from the file and plot them on a map.

  Write a university grading system in java

University grading system maintains number of tables to store, retrieve and manipulate student marks. Write a JAVA program that would simulate a number of cars.

  Wolves and sheep: design a game

This project is designed a game in java. you choose whether you'd like to write a wolf or a sheep agent. Then, you are assigned to either a "sheep" or a "wolf" team.

  Build a graphical user interface for displaying the image

Build a graphical user interface for displaying the image groups (= cluster) in JMJRST. Design and implement using a Swing interface.

  Determine the day of the week for new year''s day

This assignment contains a java project. Project evaluates the day of the week for New Year's Day.

  Write a java windowed application

Write a Java windowed application to do online quiz on general knowledge and the application also displays the quiz result.

  Input pairs of natural numbers

Java program to input pairs of natural numbers.

  Create classes implement java interface

Interface that contains a generic type. Create two classes that implement this interface.

  Java class, array, link list , generic class

These 14 questions covers java class, Array, link list , generic class.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd