The Smartguy240 Help Thread

smartguy240 OK...This is THE dumbest question ever asked...

// ****************************************************************************
//
// Logic 1: PATRICK'S QUEST VER 1.0
//
// ****************************************************************************

#include "defines.txt"
#define star o3

if (new_room) {
load.sound(127);
sound(127,f16);
load.pic(room_no);
draw.pic(room_no);
discard.pic(room_no);
set.horizon(50);
status.line.off();
prevent.input();
program.control();
show.pic();
}
animate.obj(o3);
load.view(54);
set.view(o3,54);
set.loop(o3,0);
set.cel(o3,0);
position(o3,25,149);
ignore.horizon(o3);
ignore.blocks(o3);
ignore.objs(o3);
draw(o3);


if (have.key()) {
set(menu_enabled);
clear.lines(22, 24, 0);
stop.motion(o0);
reset(f33);
new.room(2);
}

return();


I am trying to get this little star to animate on my new title screen (BTW... ;D) and i put it on there and i get the 1st cel NOT animting...sorry guys i know this is a dumb question but i just CANT figure it out!!! :-
Joel It's because your code:

animate.obj(o3);
load.view(54);
set.view(o3,54);
set.loop(o3,0);
set.cel(o3,0);
position(o3,25,149);
ignore.horizon(o3);
ignore.blocks(o3);
ignore.objs(o3);
draw(o3);


was placed outside of your new room section. That code is getting executed each interpreter cycle.

To your second question, use a counter variable, something like this:



#define vCounter v200

if (new_room)
{
vCounter = 0;
}

if (vCounter < 30)
{
vCounter++;
}
else
{
if (vCounter == 30)
{
display(20, 1, "Patrick's Quest AGI created by smartguy240");
display(21, 1, "Copyright 2002. All Rights Reserved");
vCounter++;
}
}

smartguy240 Ok Thank You Joel!!! That worked! What other instances could you use a counter var like that? Ihavent ever used one b4...?

Thanks again

BTW i have redrawn the interior of the house and the Title screen!!!!
smartguy240 how do i get 4 stars identical ot the one put on the title screen to animate at different speeds or animations without drawing new ones?
Joel To change how fast an object animates use cycle.time(). To get the animations at the same time but a little off from each other, use a timer:



#define vCounter v200

#define oStar1 o1
#define oStar2 o2
#define oStar3 o3
#define oStar4 o4

#define STAR_VIEW 54

#define STAR2_DISPLAY_TIME 4
#define STAR3_DISPLAY_TIME 8
#define STAR4_DISPLAY_TIME 12
#define MAX_STAR_DISPLAY_COUNTER STAR4_DISPLAY_TIME

if (new_room)
{
vCounter = 0;

load.view(STAR_VIEW);

animate.obj(oStar1);
// ...
draw(oStar1);
}

if (vCounter <= MAX_STAR_DISPLAY_COUNTER)
{
vCounter++;

if (vCounter == STAR2_DISPLAY_TIME)
{
animate.obj(oStar2);
// ...
draw(oStar2);
}

if (vCounter == STAR3_DISPLAY_TIME)
{
animate.obj(oStar3);
// ...
draw(oStar3);
}

if (vCounter == STAR4_DISPLAY_TIME)
{
animate.obj(oStar4);
// ...
draw(oStar4);
}
}



Note that I haven't actually tried that code, but it seems to me like it should work, although you may have to modify the actual values for STAR2_DISPLAY_TIME, etc., to get the exact effect that you want.
Joel Or you could just set a different starting cel and start them all at the same time.

set.cel(oStar1, 0);
set.cel(oStar2, 1);
set.cel(oStar3, 2);
set.cel(oStar4, 3);
smartguy240 THANK YOU THIS LOOKS SO AWESOME ON MY NEW TITLE SCREEN!!!!! Ill post a screenshot later today....