Jump to content

Board Game with OpenGL and C++

- - - - -

This topic has been archived. This means that you cannot reply to this topic.
2 replies to this topic

#1
ashino

ashino

    Newbie

  • Members
  • Pip
  • 6 posts
Hello everyone,

I am trying to program a board game like checkers but with diff rules
and i want to start step by step
first i made the board and the pieces using 2D
now i want to choose a piece and move it anywhere at first
the problem is how to connect the click of the mouse with the piece
note that x and y for the mouse click computed in pixels
and the piece uses x and y coordinates of the ortho.

My code is in the Attachment.

thanks .

Attached Files



#2
ashino

ashino

    Newbie

  • Members
  • Pip
  • 6 posts
I will use gluUnProject

gluUnProject

#3
ashino

ashino

    Newbie

  • Members
  • Pip
  • 6 posts
I have another question,

if i want to represent the position of pieces on the board using matrix,
what value should i gave them, should i represent the position using the center of the postion
x and y coordinates or is there a better way to represent them?

thanks.