Mirage

Do you have something to share with us? A tip for newbies, perhaps? Post it here.
Post Reply
peter
Active Member
Posts: 123
Joined: Mon Oct 22, 2007 2:31 pm

Mirage

Post by peter » Tue Jul 29, 2014 8:46 pm

Hello,
have fun for a while.

Code: Select all

SCREEN 320,240

Global wAmp#,wFreq#,x#,m#,cx,dx
wAmp =22.0
wfreq=10.0

s1 = LoadImage("png/coollogo.png")
s2 = LoadImage("png/stupid.bmp")

While KeyDown(27)=0
   DrawImage s1,0,0
   x=x-10.5
   m=x
   For cx=0 To ImageHeight(s2)-1
       m =m+wfreq
   For dx=0 To ImageHeight(s2)-1    
       PickImageColor s2,dx,cx
       If getRGB(RED)+getRGB(GREEN)*256+getRGB(BLUE)*65536 >0 Then        
          Box 100+dx*4+Sin(m)*wamp+1*4,100+cx*2,4,4
       EndIf   
   Next dx
   Next cx
   Color 0,0,255    
   Text 120,16,"HELLO"
   DrawScreen OFF
Wend    
Attachments
png.zip
(84.49 KiB) Downloaded 179 times

User avatar
CCE
Artist
Artist
Posts: 650
Joined: Mon Aug 27, 2007 9:53 pm

Re: Mirage

Post by CCE » Wed Aug 06, 2014 7:34 pm

Hi,

this is a legit sine wobbly sprite! You could try to make it faster with CopyBox or DrawImageBox that allow you to draw slices of images much faster.

The syntax of DrawImageBox is

Code: Select all

DRAWIMAGEBOX image, x, y, startX, startY, width, height, [frame], [transparent]
Keep up the good work :)

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest