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

  Picky publishing house publishes stories

Picky Publishing House publishes stories in three categories and has strict require- ments for page counts in each category. Create an abstract class named Story that includes a story title, an author name, a number of pages, and a String message. In..

  Determine the java application on web

Determine the Java application on Web and explain how program structure functions. Explain the application in as much detail as possible.

  Write an application that extends jframe

Write an application that extends JFrame and that displays a phrase in every font size from 6 through 20.

  How to count number of objects (instances) created

How to count number of objects (instances) Created, use java code and please be descriptive

  Design and implement a sorting algorithm

Your task is to design and implement a sorting algorithm and running time grows as a linear function of the array

  Implementation of memory management

Implementation of memory management

  Write a method in java that uses a switch statement

Write a method in JAVA that uses a switch statement and takes a person's age using an integer parameter , then checks if the age is valid (0-110), and then RETURNS a string based on the age

  Create a driver class in java

Your project is to create a driver class that uses SuperJavaIceCreamClass.

  Write a recursive method to produce a pattern

Write a recursive method to produce a pattern of n lines of asterisks.

  The game of pig

Write a program that allows a single player to practice the game (that is, there will be no opponent, just a single player). Play 5 turns in the game to get a total score for the player. Refer to the sample output below for a detailed example.

  Implement the lexical and syntactic analysis

Implement the lexical and syntactic analysis of Minifun programming language.

  Implement avl tree

Implement AVL trees that allows both iterative traversal and recursive traversal.

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