• Home
  • About
    • Bryce Newell photo

      Bryce Newell

      Here I will be writing my developer diary and will showcase some of the projects that i am working on.

    • Learn More
    • Github
  • Posts
    • All Posts
    • All Tags
  • Projects

Snake Game Update 4

29 Oct 2017

Reading time ~1 minute

Snake Update 4

After basic input, I had to make sure that the snake didn’t go off the edge of the window. To do that, I just made some simple code along the lines of:


if(snakeHeadPositionX < windowWidth * 0 || snakeHeadPositionX > windowWidth ||
   snakeHeadPositionY < windowHeight * 0 || snakeHeadPositionY > windowHeight)



blogc++low level programmingLLP Share Tweet +1