Prowler Productions
  Dink Smallwood Forum
  pushing in .c

Post New Topic  
profile | register | faq

Author Topic:   pushing in .c
nwdel posted 12-02- 05:27 AM CT (US)   Click Here to See the Profile for nwdel   Click Here to Email nwdel  
I looked in every tutorial, but I can't find how to push a tree to the left, and let it stay there.
PLEASE help me!
Tamtur posted 12-02- 03:06 PM CT (US)     Click Here to See the Profile for Tamtur  Click Here to Email Tamtur     
Check out S1-roc.c in the dink source directory. That's the script that Dink uses when the rock is pushed.

Basically, the rock is drawn not pushed and then in the main proc the script checks to see if the rock has been pushed already (by checking a global variable) and if it has, redraws it and the hard box appropriately.

Good luck.

Good luck.

nwdel posted 12-03- 01:16 PM CT (US)     Click Here to See the Profile for nwdel  Click Here to Email nwdel     
I unzipped the zip-file source and opened
S1-roc.c but all what I can see is:

void main(void)
{
}

so please put the script here.
Please???

Tamtur posted 12-04- 02:49 PM CT (US)     Click Here to See the Profile for Tamtur  Click Here to Email Tamtur     
Here it is:

void main( void )
{
sp_speed(¤t_sprite, 1);
int &mydir;
if(&rock_placement == 1)
{
sp_x(¤t_sprite, 350);
draw_hard_map();
}
}

void talk( void )
{
say_stop("Hey, looks like there's an opening behind this rock.", 1);
}

void push( void )
{

if (&strength < 4)
{
say_stop("It's too heavy for me. If I was a little stronger...", 1);
return;
}

&mydir = sp_dir(1, -1);

if (&rock_placement == 0)
{
//rock is over hole

if (&mydir == 6)
{
say("It's .. it's moving...", 1);
freeze(1);
move_stop(¤t_sprite, 6, 350, 1);
unfreeze(1);
draw_hard_map();
&rock_placement = 1;
return;
}
}

if (&rock_placement == 1)
{
//rock has already been pushed, can we push it back?

if (&mydir == 4)
{
say("..heavy..heavy..", 1);
freeze(1);
move_stop(¤t_sprite, 4, 285, 1);
unfreeze(1);
draw_hard_map();
&rock_placement = 0;
return;
}
}

say("It won't budge from this angle.", 1);

}

nwdel posted 12-05- 07:00 AM CT (US)     Click Here to See the Profile for nwdel  Click Here to Email nwdel     
Thank you!!!

Post New Topic  Post Reply
Hop to:


Contact Us | Prowler Productions

Powered by: Ultimate Bulletin Board, Freeware Version 5.10a
Purchase our Licensed Version- which adds many more features!
© Infopop Corporation (formerly Madrona Park, Inc.), 1998 - 2000.