forums

TNT Basic Forums > Programming Q&A
I need help with procedures within procedures
< Last Thread     Next Thread >
Author
Thread        Post A Reply

06-16-2003 19:52

Posted by:
JAS

Click Here to Email JAS   Find more posts by JAS

OK, I'm coding the AI for an enemy and I did something stating that if the player is within x distance then the enemy is to use the chase code that is in it's own procedure, but when I call it it doesn't let me run saying that something is wrong with the end proc...

Here's a rough idea - may not be correctly typed, but it's just to give you the idea that i'm after...

Procedure baddie()

playerx=playerx-enemyx
playery=playery-enemyy

If playerx<30 and playery<30
chase()

end proc

Something like that. Or is there a better way to do this kind of thing?

06-16-2003 22:08

Posted by:
someone

Location:
Quebec ( Canada )

Click Here to Email someone   Find more posts by someone

> saying that something is wrong with the end proc...

I'd like to see this chase() procedure. The only thing I can figure of is that you told it to return a value but you never collected it.

06-16-2003 22:09

Posted by:
someone

Location:
Quebec ( Canada )

Click Here to Email someone   Find more posts by someone

Or maybe you must put and "end if" after an if :)

06-17-2003 00:22

Posted by:
JAS

Click Here to Email JAS   Find more posts by JAS

It'd be nice to miss something BIG for once - actually not really... I think that I'm on the right path... now if only the "view" code worked :)

THANKS!

All times are GMT        Post A Reply

Forum Jump:
< Last Thread     Next Thread >

< Contact Us - TNT Basic >

Powered by: vBulletin Lite Version 1.0.1 Lite
Copyright © Jelsoft Enterprises Limited 2000.