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

  A jsp expression can contain any java expression

A JSP expression can contain any Java expression that evaluates to a

  Write down java console application to add new student

Write down java console application presents the following menu. Add new student and scores in Biology, Physics and chemistry Search for a given student.

  Determine the decision of java

Determine the decision of Java as the platform to develop this program. Identify the Java-based technologies utilized in this project and analyze each of them. Then, provide discussion on the purpose of each of the Java-based technologies utiliz..

  Write an interface for an abstract method

Write an interface, PointingDevice, containing:  an abstract method, getXCoord that returns an int and an abstract method, getYCoord that returns an int.

  Java''s type int has limit onhow large aninteger it can store

Java's type int has a limit on how large an integer it can store. This limit can be circumvented by representing an integer as an array of digits. Write an interactive program that adds two integers of up to 50 digits each.

  Write a recursive instance method

Write a recursive instance method

  Write java program to evaluate postfix expressions

Write a java program to evaluate postfix expressions containing complex numbers using a stack. This program should contain two classes.

  Write java application to input three integers from user

Write Java application that inputs three integers from user and displays sum, average, product, smallest, and largest of the numbers.

  Create application uses two-dimensional arrays

Create an application which uses 2-dimensional arrays to keep track of 5 students' grades, with each student having 3 different classes.

  Classes and pointers experience using dynamic memory

To practice defining classes using separate compilation using classes, vectors, and pointers experience using dynamic memory.

  Display student details and classes in applet

Display student details and classes they have enrolled in Applet. The Applet should have following features. Update and View.

  How to access to elements of document object model

To limit creation of malicious code, do you believe that access to elements of document object model and some Javascript functionality be limited?

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