Gamestudio Links
Zorro Links
Newest Posts
Z9 getting Error 058
by k_ivan. 04/25/26 19:13
ZorroGPT
by TipmyPip. 04/25/26 16:09
Stooq now requires an API key
by jcl. 04/13/26 09:42
Strange "Alien" Skull created with >Knubber<
by NeoDumont. 04/10/26 18:58
400 free seamless texture pack downl. here !
by NeoDumont. 04/08/26 19:55
AUM Magazine
Latest Screens
Dorifto samurai
Shadow 2
Rocker`s Revenge
Stug 3 Stormartillery
Who's Online Now
3 registered members (AndrewAMD, Grant, valino), 3,361 guests, and 13 spiders.
Key: Admin, Global Mod, Mod
Newest Members
valino, juergenwue, VladMak, Geir, ondrej
19209 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