Mouse control

Blitz3D Forums/Blitz3D Beginners Area/Mouse control

PCBGuy(Posted 2007) [#1]
I asking this a while ago and the answer given then worked but now I would like a fresh look. I am trying to pick an object up (game counter) and place it back down again. I am doing this on a specific grid (32x32) in a specific game turn, like the old historic similation war games.
My game counters are controlled by a massive "type" data base so that works OK, but my mouse control is currently very ellaberate with many for/next loops that are not easy to track. This is partly due to the fact I am looping throught the program twice, once to pick the object up and again to put it back down using active counter=null or activecounter does not = Null as the controller. The type data base has all instances of the active counter as well as many fields for other uses in the game. Again it all works but I am looking for a simpler solution. This is all done in a simple top looking down 2D space view, nothing fansy with 3D ... yet! If you can just show a simple example of a proper mouse controlling "counters" I would similate it into my existing design, thanks for any or all help!


Rob Farley(Posted 2007) [#2]
I'm not really understanding what you're asking here however, if you add a field in on your type to say if it's been picked up or not you can check for this within your single loop through your type.


PCBGuy(Posted 2007) [#3]
OK, thats would work in a simple case!


Rob Farley(Posted 2007) [#4]
Well after writing this for you I see you've changed edited you post!

Oh well... Maybe one for the code archives anyway!

http://www.blitzbasic.com/codearcs/codearcs.php?code=2001


PCBGuy(Posted 2007) [#5]
Great .... Thanks again for the extra data. I'll mull through it and see where it will help! By the way while I have your attention ... how would you do it with a hexagonal grid (Typical in strategy wargames)?

P.S. I just ran the script GREAT WORK!!!! I can definitely use the sample!!!!!!


Rob Farley(Posted 2007) [#6]
As requested...

http://www.blitzbasic.com/codearcs/codearcs.php?code=2003


PCBGuy(Posted 2007) [#7]
It worked beautifully. Again I will have to incorporate it into an existing design I worked hard on for several month but the new point of view will do much to bring me forward and add renewed interest in me doing my project! I owe you one!

-------"Your help is invaluable on this community site"----