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.

Author
Message
Andrew
22
Years of Service
User Offline
Joined: 23rd Aug 2003
Location: United Kindom (what makes it important?)
Posted: 18th Sep 2003 21:03
Hi there, i have a code setup, could you tell me if the code i am writing is correct so far.



Also i am i little stuck on the Rem character attacks enemy.
I dont know what i am supposed to be putting here, like the collision, can you help?

I think that code is wrong in someway, i think it's the code saying.
If statekey(30)=1 then attack
Or does it seem to be ok?
I though instead of having that part of the code, i thought you might place it under the attack controls like:
Rem character attacks
If statekey(30)=1 then collide objects

??

Thanks -
Andrew
David T
Retired Moderator
23
Years of Service
User Offline
Joined: 27th Aug 2002
Location: England
Posted: 18th Sep 2003 22:04
I typed this all out then I got a 404 so I have to type it all again

It depends on how you want to do attacking. I would just check the distance between you nad the enemy, and if it's within a certain distance and you're facing him, then decrease health.

Why don't you start off with walking, run, check it works then add other features?

c:/dos
c:/dos run
run dos run
Andrew
22
Years of Service
User Offline
Joined: 23rd Aug 2003
Location: United Kindom (what makes it important?)
Posted: 18th Sep 2003 22:10 Edited at: 18th Sep 2003 22:11
Yes so if i had the code:
run=0
walk=0

i can also have
health=200 right
attack=0

Thanks -
Andrew
CattleRustler
Retired Moderator
22
Years of Service
User Offline
Joined: 8th Aug 2003
Location: case modding at overclock.net
Posted: 19th Sep 2003 00:34
also your subroutine _control_Character is defined without a : at the end. I am pretty sure this wont compile properly, and not run if it does compile.

-RUST-
Andrew
22
Years of Service
User Offline
Joined: 23rd Aug 2003
Location: United Kindom (what makes it important?)
Posted: 19th Sep 2003 00:43
Without a : at the end of it????
But i thought you didn't need that?

I'm still learning codes, starting my first game, but i worry forgetting the codes i now know.
CattleRustler
Retired Moderator
22
Years of Service
User Offline
Joined: 8th Aug 2003
Location: case modding at overclock.net
Posted: 19th Sep 2003 00:47
you don't need the : to call it but you need it to declare it (at least that's what I thought and have always used

_My_Sub:
code
code code
RETURN

gosub _My_Sub

that's how I always do it because according to dbp you define a label(sub) with the : at the end, then you call with gosub labelName



-RUST-
Andrew
22
Years of Service
User Offline
Joined: 23rd Aug 2003
Location: United Kindom (what makes it important?)
Posted: 19th Sep 2003 00:51
Oh so it would basically be
Rem control character
gosub _control_character

then somewhere below
_control_character:

This sounds better?

I'm still learning codes, starting my first game, but i worry forgetting the codes i now know.
zzabb
23
Years of Service
User Offline
Joined: 25th Apr 2003
Location: Seattle, USA
Posted: 19th Sep 2003 02:05
just to let you know 'rem' is not a command
it is not needed, it is only for remarks

My advice is free -
unfortunately you get what you pay for (-:
CattleRustler
Retired Moderator
22
Years of Service
User Offline
Joined: 8th Aug 2003
Location: case modding at overclock.net
Posted: 19th Sep 2003 02:07
perfect
but remember to end your sub with the Return statement

_control_character:
blah
blah
blah
Return

when a sub is called, the code within is run, the return statement sends execution back to the line below the call to the sub

-RUST-

Login to post a reply

Server time is: 2026-07-25 07:01:16
Your offset time is: 2026-07-25 07:01:16