//====================================================
// App.cpp
//====================================================
#include "DragonFireSDK.h"

int Ballx;
int Bally;
int BallImage;
int BallView;
bool up = false;

void AppMain()
{

	Ballx=120;
	Bally=25;

	BallImage=ImageAdd("Images/Ball.jpg"); // load an image
	BallView=ViewAdd(BallImage,Ballx,Bally); // show the image on the screen



}

void AppExit()
{
	// Application exit code goes here.  Perform any clean up your app might 
	// need to do in the event of interruption by a phone call or the user
	// pressing the Home button, or some other event that would cause your
	// application to terminate.
}

void OnTimer()
{
	if((Bally< 320)&&(up ==false))
	   Bally+=2;
	else if(Bally<25)
	{
		Bally+=2;
		up = false;

	}
    else
	{
        up = true;     
		Bally -=2;

	}

	ViewSetxy(BallView,Ballx,Bally); // modify the x,y position of the view
}