fb:porticula NoPaste
timing_prob
Uploader: | ![]() |
Datum/Zeit: | 29.09.2007 16:06:31 |
do
sleep 1
if timer-time_last_step > tdiff then
with myenemy
put (.posx, .posy), del_buffer, pset 'alten standpunkt löschen
if .killed = 1 then
put (.posx, .posy), off_buffer, pset
screencopy 1,0
sleep 100
put (.posx, .posy), del_buffer, pset
enemies_in_a_row += 1
for i = 5 to 35 step 5
if enemies_in_a_row = i then PlaySample(MusicHandles(i/5),FSOUND_LOOP_OFF, fg_channel)
next i
updateEnemiesInARow(enemies_in_a_row)
time_last_step = timer
resetEnemy(myenemy, enemies_in_a_row)
end if
'temp = new coordiante
temp = .posx + .pxperstep_x 'calculate new x-pos
if temp > enemy_min_x and temp < enemy_max_x then
.posx = temp
else
.pxperstep_x = -.pxperstep_x
.posx = .posx + .pxperstep_x
end if
temp = .posy + .pxperstep_y 'calculate new y-pos
if temp > enemy_min_y and temp < enemy_max_y then
.posy = temp
else
.pxperstep_y = -.pxperstep_y
.posy = .posy + .pxperstep_y
end if
put(.posx, .posy), on_buffer, pset
time_last_step = timer
end with
end if
screencopy 1,0
if timer-time_last_second > 1 then
updateRunTime(timer-starttime)
'DrawFontString(0,430,format(int(500/(timer-time_last_second)), "0000"))
'put(0,430), notext_buffer, pset
'draw string (0,430), format(1/(timer-time_last_step),"####")
'time_last_second = timer
end if
'look what mouse is doing ;-)
getmouse mx,my,,mb
with myenemy
if mb = 1 and mb_pressed = 0 then
mb_pressed = 1
if mx >= .posx and mx <= .posx + enemy_w and my >= .posy and my <= .posy + enemy_h then
score += 100
reaction = timer-.appeartime
.killed = 1
updateReaction(reaction)
else
lives -= 1
if score > 50 then
score -= 50
else
score = 0
end if
enemies_in_a_row = 0
updateEnemiesInARow(enemies_in_a_row)
updateScore(score)
SlowDownEnemy(myenemy)
if lives = 0 then
put (.posx, .posy), del_buffer, pset
exit do
end if
end if
updateScore(score)
elseif mb = 0 then
mb_pressed = 0
end if
end with
loop