Unicorn wrote:
Does the object visible speed up? It could be because you are taking some display things off the screen, thus resulting in a speedup.
Yeah, normally it just slowly inches along, but when I jump, it speeds up.
EDIT: I tried it with Cesium, and when I have the backup option off, it works. But when its on, it doesnt back it up and just resets the emulator.
EDIT 2: Again, what can I do to this code? Whenever I jump, the obstacle speeds up too.
Code:
while(death==0){
draw_tracks();
gfx_Sprite( train, 0, 96 );
if (key & kb_Up) {
train_jump();
}
if (137<=a+65 & (obst_x<=76 & obst_x>=20)){
death=1;
}
if (obst_x<=0){
obst_x=320;
}
key = kb_ScanGroup(kb_group_7);
}
}
void draw_tracks(){
obst_off();
obst_x-=4;
gfx_Sprite( obstacle, obst_x, 137);
}
void train_jump(void){
for(a=96;a>40;a--){
for(x=0; x<25;x++){gfx_Sprite( train, 0, a );}
drawtrain_off();
draw_tracks();
}
for(;a<=96;a++){
for(x=0; x<25;x++){gfx_Sprite( train, 0, a );}
drawtrain_off();
draw_tracks();
}
}
void obst_off(void){
gfx_SetColor(95);
gfx_FillRectangle_NoClip(obst_x,137,24,24);
}