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.

DarkBASIC Professional Discussion / Can i have a code like this for my enemies?

Author
Message
Andrew
22
Years of Service
User Offline
Joined: 23rd Aug 2003
Location: United Kindom (what makes it important?)
Posted: 16th Sep 2003 20:24
Cani have a code at the top going:
Rem create enemies
gosub_create_enemies

Then down the bottom have:
_create_enemies
Load object........

Will this code work, so even when i want the character to attack the enemies, it will read that code?
Andrew
22
Years of Service
User Offline
Joined: 23rd Aug 2003
Location: United Kindom (what makes it important?)
Posted: 16th Sep 2003 21:17
??
TKF15H
23
Years of Service
User Offline
Joined: 20th Jul 2003
Location: Rio de Janeiro
Posted: 16th Sep 2003 21:40
it's not very clear what it is you're trying to do. But if you're doing what I think you're doing, then, yes you can do it. Just remember to use a return after the "gosub _create_enemies" with a space after the gosub.

I need an animator!!! HELP ME!!
Andrew
22
Years of Service
User Offline
Joined: 23rd Aug 2003
Location: United Kindom (what makes it important?)
Posted: 16th Sep 2003 22:13
I'm trying to load an enemie, so the question is, can i use that code to make a enemie, and then use it when it'd being attack, etc
David T
Retired Moderator
23
Years of Service
User Offline
Joined: 27th Aug 2002
Location: England
Posted: 16th Sep 2003 22:15
Yes! Any object loaded using load object can be used. Full stop.

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: 16th Sep 2003 22:34
Thanx, i did know but i just wanted to check.
Also my game has 2 different type of enemies, so can i load both eneimies in the same place like:
Rem create enemies
_create enemies
load object (file),1
Load object (file2),2

?
ReD_eYe
23
Years of Service
User Offline
Joined: 9th Mar 2003
Location: United Kingdom
Posted: 16th Sep 2003 22:47
yes that would also work


Andrew
22
Years of Service
User Offline
Joined: 23rd Aug 2003
Location: United Kindom (what makes it important?)
Posted: 16th Sep 2003 22:59
Great
MikeS
Retired Moderator
23
Years of Service
User Offline
Joined: 2nd Dec 2002
Location: United States
Posted: 16th Sep 2003 23:54
Quote: "Thanx, i did know but i just wanted to check."


Just go try it then.
Save yourself some time.



A book? I hate book. Book is stupid.
zircher
23
Years of Service
User Offline
Joined: 27th Dec 2002
Location: Oklahoma
Posted: 18th Sep 2003 03:14
Yellow has a good point, you can a learn a lot just by trying it out. The help files are your friend and they are very patient.
--
TAZ
Andrew
22
Years of Service
User Offline
Joined: 23rd Aug 2003
Location: United Kindom (what makes it important?)
Posted: 18th Sep 2003 12:32 Edited at: 18th Sep 2003 12:53
Is it ok to have this code:
Rem create enemeys
gosub _create_enemys at the top and load the enemys down the bottom?
Also could i have a caode like this for my game:

Rem start of actions for character
walk=0
run=0
attack1=0
attack2=0
health=200

So basically can i have "health=200" here?

Thanks -
Andrew
Andrew
22
Years of Service
User Offline
Joined: 23rd Aug 2003
Location: United Kindom (what makes it important?)
Posted: 18th Sep 2003 17:03 Edited at: 18th Sep 2003 17:35
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
Andrew
22
Years of Service
User Offline
Joined: 23rd Aug 2003
Location: United Kindom (what makes it important?)
Posted: 18th Sep 2003 18:51
Any help???

Thanks -
Andrew
zircher
23
Years of Service
User Offline
Joined: 27th Dec 2002
Location: Oklahoma
Posted: 19th Sep 2003 05:42
Have patience, grasshopper. In your first message, initializing variables at the beginning of the program is standard practice. (Beginning is relative to execution order, so the subroutine call is OK.)
--
TAZ

Login to post a reply

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