Sapphire 2 Director Project

Friday, February 18, 2005

Another Director tester

Clubbing
O.K. This one does some more complicated stuff.
The morality bars themselves were the most complicated things to do. They needed to expand when something happened. Also they need to not expand past a certain point but still keep adding morality points. Also the opposite bar needed to contract when the other side went up, but not to do that if it is already fully collapsed (it did start going back the other way).

I know you're eager to see it so here is the code.

FOR A MORALY BAD ACTION

global gMoralCompass
on mouseUp me
gMoralCompass = gMoralCompass - 1
put gMoralCompass


if sprite(7).width < 120 and gMoralCompass < -0.1 then
sprite(7).width = sprite(7).width + 30
sprite(7).left =sprite(7).left - 30
put "lengthen bad bar"
end if
if sprite(6).width > 1 and gMoralCompass < 4 then
sprite(6).width = sprite(6).width - 30
end if
end



FOR A MORALY GOOD ACTION

global gMoralCompass
on mouseUp me
gMoralCompass = gMoralCompass + 1
put gMoralCompass

if sprite(6).width < 120 and gMoralCompass > 0.1 then
sprite(6).width = sprite(6).width + 30
put "lengthen good bar"
end if
if sprite(7).width > 1 and gMoralCompass > -4 then
sprite(7).width = sprite(7).width - 30
sprite(7).left =sprite(7).left + 30

end if
end


-- The sprite(6) is the bar showing good alignment.
-- The sprite(7) is the bar showing bad alignment.

As well as that we've got the money thing, and testing both at the same time if you have enough money and what you moral alignment is to return different outcomes.

0 Comments:

Post a Comment

<< Home