Guess Who- Simple Game

Post gaming related scripts
User avatar
Kenzis
Posts: 15
Joined: 01 May 2020, 13:05

Guess Who- Simple Game

08 Sep 2023, 03:42

This Game so so simple, and I do think it may be fun in some occurrences, as all you have to change is the [Images] in the corresponding Folders.
The rules are in the ReadMe File.
This is based off of a simple short from YouTube I saw https://www.youtube.com/shorts/9IWLIzaVtQw and the game looked cool to me, so I made it myself on the PC, literally barebones.
Here's the source code:

Guess Who.ahk

Code: Select all

#NoEnv  ; Recommended for performance and compatibility with future AutoHotkey releases.
#Warn  ; Enable warnings to assist with detecting common errors.
SendMode Input  ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir%  ; Ensures a consistent starting directory.

w1 := A_ScreenWidth/2.5
 h1 := A_ScreenHeight/1.2

; Create the GUI interfaces
 Gui, Player1:New
  Gui, Player1:Add, Picture, w768 h900 x0 y0, %A_ScriptDir%\player1_pictures\animals.png
  Gui, Player1:Show, x100 y70 w%w1% h%h1%, Interface 1
   Gui, Player2:New
   Gui, Player2:Add, Picture, w768 h900 x0 y0, %A_ScriptDir%\player2_pictures\animals.png
    Gui, Player2:Show, x1050 y70 w%w1% h%h1%, Interface 2
	 Run, %A_ScriptDir%\executables\sprite_creator.ahk
 
; Check if whether or not the Interface is existing, if not Exit the App
Loop
 {
  IfWinNotExist, Interface 1 
   Goto, QuitLabel
    Else
     IfWinNotExist, Interface 2
      Goto, QuitLabel
       }
 
 ; Quit all clients
QuitLabel:
  {
   ExitApp
  }

Sprite Creator

Code: Select all

#NoEnv  ; Recommended for performance and compatibility with future AutoHotkey releases.
#Warn  ; Enable warnings to assist with detecting common errors.
SendMode Input  ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir%  ; Ensures a consistent starting directory.
SetBatchLines, -1
CoordMode, Mouse, Screen

 ; Beginning value of the starting GUI name
  newnumber := 0
  
 ; The complete function.
repeat_sprite_creation:
 IfWinNotExist, Interface 1
  ExitApp
 Else
  IfWinNotExist, Interface 2
  ExitApp
 Else
 ; Send White Sprites to the mouse Cursor Position
KeyWait, LButton, D
  newnumber := newnumber + 1
  spritename = %newnumber%
 MouseGetPos, xm, ym
  Gui, %spritename%:New, -border -sysmenu -Caption
  Gui, %spritename%:Color, White
  Gui, %spritename%:+AlwaysOnTop
  Gui, %spritename%:Show,% "x"xm-50 "y"ym-50 "w"90 "h"90
  KeyWait, LButton, P
 Goto, repeat_sprite_creation
  
 
If anyone want's to try playing this, I deem you it will be fun, Just follow the rules in the ReadMe, and make some pictures
or edit them yourself, mainly because mine are in my own language, and it's just animals, and some of you may use people or objects
instead.


Cheers :wave:
Attachments
Guess Who.rar
Guess Who - The Game
(967.61 KiB) Downloaded 90 times

Return to “Gaming Scripts (v1)”

Who is online

Users browsing this forum: No registered users and 76 guests