Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: How can I create a grid?  (Read 1621 times)

0 Members and 1 Guest are viewing this topic.

Redpandaboss09

  • Newbie
  • *
  • Posts: 2
    • View Profile
How can I create a grid?
« on: July 20, 2021, 10:20:03 pm »
Hello all,

I'm new to SFML and still learning C++ and wanted to make the game Battleship. I've created this game in the console before but want to create it in a window with better AI. How can I create two 10x10 grids, each on their own side of the screen? I can give you a link to the code: https://github.com/Redpandaboss09/-battleship

Stauricus

  • Sr. Member
  • ****
  • Posts: 299
    • View Profile
    • Email
Re: How can I create a grid?
« Reply #1 on: July 21, 2021, 04:09:44 pm »
just draw some lines horizontally and then vertically

search 'Line without thickness' here:
https://www.sfml-dev.org/tutorials/2.0/graphics-shape.php

 

anything