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 / Dark basic Multi Enemy coding

Author
Message
MPalmer
14
Years of Service
User Offline
Joined: 21st Mar 2012
Location:
Posted: 21st Mar 2012 13:50
hello i am a student at a college in my area and i have to code multiple enemies within my program, i am required to code multiple zombie enemies please help me.
here is some of my coding:

Load object "H-Zombie-Attack1.x",4
Scale object 4,3000,3000,3000
Loop object 4
position object 4,4900,Get Ground Height(1,5000,5500),5500
TheComet
18
Years of Service
User Offline
Joined: 18th Oct 2007
Location: I`m under ur bridge eating ur goatz.
Posted: 21st Mar 2012 17:51 Edited at: 23rd Mar 2012 18:09
Hi MPalmer


Check into arrays. For every enemy you create, you assign it an ID. This ID is later used to access the enemy's data within the array. Here's some code showing an array:



So this would be how to create a zombie:



TheComet

Pincho Paxton
23
Years of Service
User Offline
Joined: 8th Dec 2002
Location:
Posted: 21st Mar 2012 18:04
What's loop object 4?

Penfold
22
Years of Service
User Offline
Joined: 3rd Dec 2003
Location: RED postbox houses of parliment
Posted: 21st Mar 2012 20:27
Quote: "What's loop object 4?"


play object 4,firstframe,lastframe,repeat

'Ooh 'eck chief'...'crumbs'
MPalmer
14
Years of Service
User Offline
Joined: 21st Mar 2012
Location:
Posted: 23rd Mar 2012 02:57
Thank you very much TheComet! you helped me very much...again thank you!
TheComet
18
Years of Service
User Offline
Joined: 18th Oct 2007
Location: I`m under ur bridge eating ur goatz.
Posted: 23rd Mar 2012 18:10
Happy to have been of assistance. If you need any further help, I'll be lurking about in the shadows of TGC.

TheComet

Login to post a reply

Server time is: 2026-07-09 17:43:03
Your offset time is: 2026-07-09 17:43:03