Jump to content

  • Log In with Google      Sign In   
  • Create Account

FREE SOFTWARE GIVEAWAY

We have 4 x Pro Licences (valued at $59 each) for 2d modular animation software Spriter to give away in this Thursday's GDNet Direct email newsletter.


Read more in this forum topic or make sure you're signed up (from the right-hand sidebar on the homepage) and read Thursday's newsletter to get in the running!


Moving diagonally (Chess) logic


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
1 reply to this topic

#1 SonicD007   Members   -  Reputation: 464

Like
1Likes
Like

Posted 25 June 2012 - 08:06 PM

Hey everyone, I'm writing a simple chess clone and I'm not sure how to implement the diagonal moving. I already made the Pawn, Knight, and Rook, but I'm having trouble on figuring out the diagonal moving through a 2d array. Anyone have an algorithm or guide on implementing diagonal moves? Thanks! (I'm working on the Bishop now)


EDIT: A shower later and I just realized the same way I did the attacking for the Pawn is how I would do the diagonals for the Bishops. Sometimes typing the question out and a nice shower helps get the brain working haha! Thanks anyway!

Edited by SonicD007, 25 June 2012 - 08:25 PM.


Sponsor:

#2 Tom Sloper   Moderators   -  Reputation: 10164

Like
3Likes
Like

Posted 25 June 2012 - 08:49 PM

I agree. Showers are excellent thinking stimulators.
-- Tom Sloper
Sloperama Productions
Making games fun and getting them done.
www.sloperama.com

Please do not PM me. My email address is easy to find, but note that I do not give private advice.




Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS