xna - How to move a rectangle in chess game -
i programming chess , wanted know how can change spot of rectangles. if need more informations let me know in answers. happy if answers me. thanks.
a rectangle has int x
, y
component. represent position on screen. x: 0, y: 0
represents upper left corner of screen. they're measured in pixels.
example(assumingly in game class)
rectangle chesspiece1; // in init function: chesspiece1.x = 100;
you'll see chess piece has moved 100 pixels right on screen(if you've drawed of course).
// if put in update function, chess piece move 1 pixel right every time update function called! chesspiece.x++;
and can in y
direction too.
more info here. also: assume new stackoverflow, people can little harsh if ask "fix me please". here's info on how make neat questions.
Comments
Post a Comment