CSC 234 - Project 2

Ripples

Assigned Jan 28
Due Feb 1 4pm


This assignment creates a drawing program, where you touch the screen, and a wave will ripple away from where you touched.

First, create a new Android Project called Ripples. Use the package edu.centenary.USERNAME.drawtouch and select Android SDK version 17.

Copy the following MainActivity.java file into the package you created under the src directory. This is the controller which runs the application.

Copy the icon ic_launcher.png file into the res/drawable-hdpi directory. This is the icon for your application.

To complete this project, you will need to make a Wave class that has the following structure:

First, import the library for android.graphics.RectF. This is how Android represents a rectangle for drawing objects to the screen. It has floats as data members for the left, top, right, and bottom boundaries.

You will need three double data members, one to keep track of the x coordinate of the center of the wave, one to track the y coordinate of the center, and one to track the energy of the wave.

You will also need three constants, one integer for the maximum energy of the wave, called MAXENG, set equal to 200, one integer for the minimum energy of a wave, called MINENG, set equal to 10, and one double for the decay rate of the wave, called DECAY, set equal to 0.99.