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 / objects and arrays

Author
Message
Neotron
16
Years of Service
User Offline
Joined: 21st Jul 2010
Location: I am in an underworld , making a E.Army
Posted: 25th Sep 2010 17:22
Hi all

O.K. this is really annoying me REALLY!!!!!!!!!!!!


Tell me what is the problem with these function.



objno is the bullet used.

ALLAH IS THE GREATEST
May he forgive me
MSon
22
Years of Service
User Offline
Joined: 13th Jul 2004
Location: Earth, (I Think).
Posted: 25th Sep 2010 18:12 Edited at: 25th Sep 2010 18:12
I can see several errors in this bit of code, i will rewrite it now and post a fixed version in a minute.

MSon
22
Years of Service
User Offline
Joined: 13th Jul 2004
Location: Earth, (I Think).
Posted: 25th Sep 2010 18:28 Edited at: 25th Sep 2010 18:36
here you go, I rewrote it, One section is remmed out, but it is working now.



Id suggest keeping dim sizes down and low object numbers if possable, as this will help speed up your game, I assume Limb is so it fires from a hand or gun mobel, i used Limb 0 as this is the Root Limb, which every object has, Theres no collision in this code, but you can fire as many bullets as you wish.

Neotron
16
Years of Service
User Offline
Joined: 21st Jul 2010
Location: I am in an underworld , making a E.Army
Posted: 25th Sep 2010 19:11
Thnx very much for the code.

Now that you have posted in my post (i have caught you and won;t let you go!!) i would like to ask you about resizing an array.

If you go to the blitz3d site, it uses NEW and EACH commands for making and updating an object.

thnx again for the code i love it.

ALLAH IS THE GREATEST
May he forgive me
MSon
22
Years of Service
User Offline
Joined: 13th Jul 2004
Location: Earth, (I Think).
Posted: 25th Sep 2010 19:19 Edited at: 25th Sep 2010 19:28
no prob, i dont know about Blitz as havn't used it in so many years, but you asked about resizing an array, You can use the following commands to do this.



There is also a command to insert or remove a dim entry at a specific point in the array, But i cant remember what they are, But if you press F1 in the editor to bring up the help, it will be listed there somewhere, (Maybe under Core Commands).

Neotron
16
Years of Service
User Offline
Joined: 21st Jul 2010
Location: I am in an underworld , making a E.Army
Posted: 25th Sep 2010 20:31
umm thnx.

I actually found out how it works.


Solved.

ALLAH IS THE GREATEST
May he forgive me

Login to post a reply

Server time is: 2026-07-24 23:12:47
Your offset time is: 2026-07-24 23:12:47