Creating an App

I am Creating an app using Dragonfire Sdk in c++. I need some help with my code. So far this is what I have:

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

// calling resources
int bx;
int by;
int bv;




void AppMain()
{
// Main / startup code
ViewAdd("Images/Backround.png",0,0);
bx=150;
by=320;
bv=ViewAdd("Images/ball.png",bx,by);

}


void AppExit()
{
//end app
}

void OnTimer()
{
// This repeats 30 times a second
int accx;
int accy;

accx=TiltGetx();
accy=TiltGety();

bx=ViewGetx(bv)+(accx / 100);
by=320;
if (bx < 0)
bx=0;
if (bx>295)
bx=295;
ViewSetxy(bv,bx,by);

}

I need a code that allows me to spawn an instance from 0,0 to 0,295 (instance name enemy.png) it needs to have a 1/30 chance of spawning because the script will loop 30 times a second. Please help
Topic archived. No new replies allowed.