Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Newcomers DBPro Corner / flip mirror sprite problem

Author
Message
chromatic3d
13
Years of Service
User Offline
Joined: 7th Oct 2011
Location: rnd
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
Pincho Paxton
21
Years of Service
User Offline
Joined: 8th Dec 2002
Location:
Posted: 29th Mar 2012 19:41
I usually just draw everything flipped, it's less hassle.

chromatic3d
13
Years of Service
User Offline
Joined: 7th Oct 2011
Location: rnd
Posted: 30th Mar 2012 17:27 Edited at: 31st Mar 2012 00:52
Yes you are right. I will do that. thanks. It is strange that it does not work right. There may be faster and better ways to do this and it sure does not seem worth fixing as a bug but if you want to flip a sprite the first thing you look to is flip sprite. There should be a post of stuff that doesn't work that should but is really not worth fixing if you know what I mean. It would save new people time and keep them from getting too fustrated. hmmmm

I figured it out by using SCALE OBJECT TEXTURE 1, -1,-1 and using it one time before the loop as it still works even if you change the texture image.

Login to post a reply

Server time is: 2024-11-23 20:44:16
Your offset time is: 2024-11-23 20:44:16