Oxygen Basic

Programming => Example Code => Topic started by: Peter on December 03, 2015, 03:08:08 AM

Title: Constrain Demo
Post by: Peter on December 03, 2015, 03:08:08 AM
Hello,
Code: [Select]
include "asm.inc"
Window 640,400,1

LoadImage  "bmp/pic1.bmp"
LoadSprite "bmp/bird.bmp",8

single x, y=200
int w = ScrW, z

while Key(27)=0
ImageBlend 1,0,0,640,400,10
Color 255,20,25
Text 120,0,20,"Constrain Example"
y = 200+100*sin(rad(x))
Sprite 1,x,y,48,48,z
y = 200+100*cos(rad(x))
Sprite 1,x,y,48,48,z
iF Constrain(x, 0, w) >0
   x +=2
Else
   x = 0
End iF 
z +=1: if z=8 then z=0
Redraw
Wait 20
Wend
WinEnd


.
Title: Re: Constrain Demo
Post by: Mike Lobanovsky on December 03, 2015, 03:21:57 AM
Peter,

The birds are leaving faint smear on the screen. It doesn't disappear completely. Is it how it should be?
Title: Re: Constrain Demo
Post by: Peter on December 03, 2015, 02:40:27 PM
Quote
The birds are leaving faint smear on the screen. It doesn't disappear completely. Is it how it should be?

Yes, is correct!  That's blend.