Posted: 29th Mar 2012 16:58
I am trying to make a simple kaleidoscope using sprites with pictures that change when you press the mouse button. However the sprites do not always flip and mirror. About half the time they work and half they do not. I have no idea why and am running out of things to try to fix it. Here is the code with media.
Rem Project: kalide
Rem Created: Monday, March 26, 2012
Rem ***** Main Source File *****
ww=DESKTOP WIDTH()
hh=DESKTOP HEIGHT()
SET DISPLAY MODE ww, hh, 32, 1
color backdrop 0,rgb(0,0,0)
cp=1
for i = 1 to 9
bb$=str$(i)
bm$=".bmp"
bn$="media/image0"+bb$+bm$
load image bn$,i,0
NEXT
for i = 10 to 30
bb$=str$(i)
bm$=".bmp"
bn$="media/image"+bb$+bm$
load image bn$,i,0
NEXT
for i = 1 to 4
SPRITE i, i*100, i*100, i
scale sprite i, 400
next
SPRITE 1, 4000, 4000, 1
SPRITE 2, 4000, 4000, 1
SPRITE 3, 4000, 4000, 1
SPRITE 4, 4000, 4000, 1
do
mc=mouseclick()
if mc=1
sc=rnd(29)+1
SET SPRITE IMAGE 1, sc
SET SPRITE IMAGE 2, sc
SET SPRITE IMAGE 3, sc
SET SPRITE IMAGE 4, sc
rem
mirror SPRITE 4
flip SPRITE 4
MIRROR SPRITE 2
flip SPRITE 3
sync
// PASTE SPRITE 1, 1, 1
// PASTE SPRITE 2, ww/2, 1
// PASTE SPRITE 3, 1, hh/2
// PASTE SPRITE 4, ww/2, hh/2
endif
PASTE SPRITE 1, 1, 1
PASTE SPRITE 2, ww/2, 1
PASTE SPRITE 3, 1, hh/2
PASTE SPRITE 4, ww/2, hh/2
CONTROL CAMERA USING ARROWKEYS 0, 10, 3
LOOP
Attachments
Login to view attachments