Gamestudio Links
Zorro Links
Newest Posts
Zorro 2.70
by jcl. 09/29/25 09:24
optimize global parameters SOLVED
by dBc. 09/27/25 17:07
ZorroGPT
by TipmyPip. 09/27/25 10:05
assetHistory one candle shift
by jcl. 09/21/25 11:36
Plugins update
by Grant. 09/17/25 16:28
AUM Magazine
Latest Screens
Rocker`s Revenge
Stug 3 Stormartillery
Iljuschin 2
Galactic Strike X
Who's Online Now
0 registered members (), 18,008 guests, and 5 spiders.
Key: Admin, Global Mod, Mod
Newest Members
krishna, DrissB, James168, Ed_Love, xtns
19168 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
chess.. #296809
11/03/09 05:59
11/03/09 05:59
Joined: Oct 2009
Posts: 6
Cavite Philippines
jhuLie Offline OP
Newbie
jhuLie  Offline OP
Newbie

Joined: Oct 2009
Posts: 6
Cavite Philippines
hi..

i'm creating a 3d chess game.i'm done modelling the board and pieces..

recently, i encountered a problem with regards to the movement of the pieces..

i'm not dealing with AI yet..

my problem is how to place a piece to its destination once i clicked it..

thankz a lot..:)


jhuLieaNn
Re: chess.. [Re: jhuLie] #296811
11/03/09 07:31
11/03/09 07:31
Joined: Oct 2007
Posts: 306
Austria
A
Alan Offline
Senior Member
Alan  Offline
Senior Member
A

Joined: Oct 2007
Posts: 306
Austria
Hi,

I don't know whether you made up your chess board in ONE model or every square as a seperate model, but if you choose for each square to be a seperate entity, you may use the "mouse_ent" pointer to determine which square the mouse currently points at. The manual will help you using mouse_ent correctly. Then, if the left mouse button is clicked, simply call a function (or *assign* that function to the left mouse button, I think that's possible too) which moves the selected piece (simply create a pointer which is assigned to a piece when it is left clicked upon using mouse_ent once more) to the selected square using the "c_move(...)" command.

However, in case that your entire chess board consists of only *one* model, things are getting way more complex. Maybe someone else can answer that? Because I have no idea xD


Greets,



Alan

Re: chess.. [Re: Alan] #296819
11/03/09 08:36
11/03/09 08:36
Joined: Nov 2007
Posts: 1,143
United Kingdom
DJBMASTER Offline
Serious User
DJBMASTER  Offline
Serious User

Joined: Nov 2007
Posts: 1,143
United Kingdom
Yeh, if the board is made up of 64 seperate squares, then use alan's method. If it is one model, then you will have to trace from the camera to the mouse position and then place the piece acordingly. Then you will have to do some 'bounds' checking to see which square it is.

mouse_pos3d, mouse_dir3d should help.


Moderated by  HeelX, Lukas, rayp, Rei_Ayanami, Superku, Tobias, TWO, VeT 

Gamestudio download | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1