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

  Write a program that reads a set of floating-point

Write a program that reads a set of floating-point data values from the input.

  Write a recursive method to produce a pattern

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

  Write jvm program which accepts rpn expression

Write down the IJVM program which accepts RPN expression, with each operand and operator entered line by line. As each number (operand) is entered, push it on stack.

  Write a program that assigns seats on an airplane

Prepare a program that teaches arithmetic to a young child. The program tests subtraction and addition. Write a program that assigns seats on an airplane.

  Write servlet code for accepting two numbers from user

Write the servlet code for accepting two numbers from user show addition and multiplication of numbers. If error occurs, then call JSP error page to display suitable error message.

  Creating the gui for the game interface

A GUI-based application that allows a user to play a simple trivia game

  Create bean jsp program which will compute simple interest

Create the bean which will compute Simple Interest. Use bean in JSP program. Accept details of saving like principal amount, rate of interest, period-in years from user and show amount

  Finding java code error

Indicate in the given code segment if an error occurs. If so, point to whether it is syntax, runtime or logic and how you would fix it.

  Write a program that shows the current time and date

Write a program that shows the current time and date

  Implement a class quiz

Implement a class Quiz that implements the Measurable interface.

  Write complete java program to read from keyboard

Write complete Java program to read, from keyboard, a student's first and last name and six grades. It will display on screen last name then first letter of first name with a period.

  Write java code to read integers from an input file

write java code to read integers from an input file and write only the odd numbers to an output file. the two file names will be provided on the command line as the input file followed by the output file.

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