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.

Newcomers DBPro Corner / Determine what texture an object is textured with

Author
Message
bruceatk
21
Years of Service
User Offline
Joined: 25th Aug 2003
Location: Loudon, NH
Posted: 21st Sep 2003 16:05
Is there a command that lets you tell what texture was used to texture an object. I am writing a simple game to help me learn DarkBasic Pro. I already have the game board up with all the pieces able to be placed and I am working on the logic to determine when you have won.

I could create a data structure that mimics the state of the playing pieces but the playing pieces themselves would be enough info if I could get the current texture number. I am only using two textures for the game pieces. The playing pieces are numbered 1 through 64 and the number that they are also reflects where they are. If they are not hidden then they are valid pieces and I would like to loop through all the unhidden pieces and determine their current state.

Thanks,
Bruce
spooky
22
Years of Service
User Offline
Joined: 30th Aug 2002
Location: United Kingdom
Posted: 21st Sep 2003 17:31
There is no command but why not just have objects 1-32 for player 1 and 33-64 for player 2. Easy, then the the object number gives away what player it is for. Also, use 'object visible' command to determine if object is hidden or not.

If your mansion house needs haunting, just call Rentaghost!
IanM
Retired Moderator
22
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 21st Sep 2003 17:55
I think what he wants is a simple way to count the types of each object - maybe for a version of othello/reversi?

I'm afraid that you'll need to keep track yourself
bruceatk
21
Years of Service
User Offline
Joined: 25th Aug 2003
Location: Loudon, NH
Posted: 22nd Sep 2003 01:24
The object numbers are reflective of the position that they are in, so I can't group them 1-32 and 33 to 64.

I can keep an array and just store a 1 or 2 for which player the object belongs to, it just seemed redundant. If there was a way to retrieve that information without duplicating it then I would have used that instead.

Thanks,
Bruce

Login to post a reply

Server time is: 2024-09-21 01:02:11
Your offset time is: 2024-09-21 01:02:11