Hello everybody I am new here and to C++ coding, i know all the basics
so i decided it would be fun to just write a fun Ascii game.
here is my idea for the game:
so i am making the game so it draws X’s (enemys) all over the screen
randomly and your goal is to shoot all the x’s (click them lol).
so far i have the function that draws the screen, draws the enemys
i just need to write a function to see if the person hit or missed
(when trying to “shoot” the enemy’s)
so i know i have to use get cursor pos, and have to compare it to see
if there is an enemy where the cursor is then check to see if the person
clicked (i know the key codes)
so i was just wondering if some one could give me som insight on how to
p.s im making it in a console window lol, so no win32 bs.
thanks in advance,
Please log in or register to post a reply.
I am not sure what you mean by console window, but as far as I know, you
can’t simply get mouse position in this mode.
I would suggest you to do it in SDL, it isn’t much more complicated than
that and your game will be fancier. Also getting input via SDL is very
You can take a look at the Win32 Console Reference here:
However, I don’t think it will allow for what you want to do…
I take that back. It looks like you can grab the character coordinate of
a mouse click by retrieving a MOUSE_EVENT_RECORD structure with the
ReadConsoleInput function. See an example here:
IMHO, you would be better off taking kulik’s approach and using SDL.
alright so if sdl isnt to complex ill try it with sdl