Jump to content

Sky Slate Blueberry Blackcurrant Watermelon Strawberry Orange Banana Apple Emerald Chocolate
Photo

I need help with my game of Checkers.


  • Please log in to reply
6 replies to this topic
Eedis
  • Members
  • 1775 posts
  • Last active: Aug 14 2015 06:33 PM
  • Joined: 12 Jun 2009
So I'm completely bored out of my mind. I need something new to do. My friend suggested I make a game of checkers. I thought, well, that wouldn't be so hard. So I have a simple question.

I'm using a GUI with an image, here, of an image I have for a board. I used photoshop to make some checker pieces, here, but when you try to put the checker image over the board image, you get the white square around the checker piece.

I just wanted these checker pieces because I made them and they're a bit more fancy than a solid color. I know you can make these shapes using AHK itself, I just wanted something a bit more fancy. If anyone could help me take out that white square and just have the checker piece that'd be amazing.

I don't know how to make the shapes with AHK either, so it'd be great if someone could help me with that as well.
AutoHotkey state, the forum, Poly, and Drainx1. The short story.
I love my wife, my life, my atomic-match; for giving me the greatest gift a man could ask for, such a perfect and beautiful little girl.
9rjbjc.png

jaco0646
  • Moderators
  • 3165 posts
  • Last active: Apr 01 2014 01:46 AM
  • Joined: 07 Oct 2006

I thought, well, that wouldn't be so hard. So I have a simple question.

It will be harder than you imagine, but I highly encourage you to do it anyway. :wink: I love simple games.

If anyone could help me take out that white square and just have the checker piece that'd be amazing.

BackgroundTrans

I don't know how to make the shapes with AHK either, so it'd be great if someone could help me with that as well.

The simplest way is using text from the WebDings font. The games I've made use this (check the link in my sig).

Eedis
  • Members
  • 1775 posts
  • Last active: Aug 14 2015 06:33 PM
  • Joined: 12 Jun 2009

I thought, well, that wouldn't be so hard. So I have a simple question.

It will be harder than you imagine, but I highly encourage you to do it anyway. :wink: I love simple games.


Well yes, but I made a Connect Four game and I have a rather simple idea for how to make this game work. Although time consuming, which I don't mind because I have all the time in the world.

Thanks for the ideas. :) I will try the backgroundtans idea first, then I might have to result in using webdings shapes. Thanks for the input. :)
AutoHotkey state, the forum, Poly, and Drainx1. The short story.
I love my wife, my life, my atomic-match; for giving me the greatest gift a man could ask for, such a perfect and beautiful little girl.
9rjbjc.png

txquestor
  • Members
  • 294 posts
  • Last active: Jul 24 2015 08:12 PM
  • Joined: 22 Aug 2009
Is this the less than inifinte quest your currently pursuing :?: :lol:
Posted Image
"Man's quest for knowledge is an expanding series whose limit is infinity"

Eedis
  • Members
  • 1775 posts
  • Last active: Aug 14 2015 06:33 PM
  • Joined: 12 Jun 2009
Haha.

It indeed is txquestor. :D
AutoHotkey state, the forum, Poly, and Drainx1. The short story.
I love my wife, my life, my atomic-match; for giving me the greatest gift a man could ask for, such a perfect and beautiful little girl.
9rjbjc.png

Meredith
  • Members
  • 11 posts
  • Last active: Dec 06 2010 06:25 AM
  • Joined: 07 Oct 2009
if you cant get it to work you could just cheat.... just using photoshop put the board under the piece... so in otherwords the piece is your piece + what the board is.
example
Posted Image
and that's 1 piece

txquestor
  • Members
  • 294 posts
  • Last active: Jul 24 2015 08:12 PM
  • Joined: 22 Aug 2009
Relative to the picture shown by Meredith.

How about creating a single light and dark square with red and black checker ovelayed.

Then merge into a checkerRedLight piece and checkerRedDark piece. and checkerBlackLight piece and checkerBlackDark peice

Then you can either Move each object or hide/show each object to play
Checkers.

Here is a script that manually moves an image around the desktop by dragging it with the mouse. I created my own checker image/s like Meredith.
; AnimationGif

; Manually move a GIF under the mouse around the desktop - How to automate

; by IsNull  - http://de.autohotkey.com/forum/viewtopic.php?t=3628

#NoEnv
SetWinDelay, -1
; SetBatchLines, -1
; SetControlDelay, -1

OnMessage(WM_NCMOUSEMOVE:=0xA0, "NCMouseMove")
OnMessage(WM_MOUSEMOVE:=0x200, "MouseMove")
OnMessage(WM_LBUTTONDOWN:=0x201, "MouseClick")
OnExit, ExitHandler

Fadenkreuz:=  A_ScriptDir "\CheckerRedLight.png"
Hintergrund:= A_ScriptDir "\CheckerRedDark.png"

Gui, +ToolWindow +LastFound
Gui1ID := WinExist()
Gui, Margin, 0, 0
GUI, Add, Pic, HwndPicID, %Hintergrund%
ControlGetPos, X, Y, W, H, , ahk_id %PicID%
Gui, 2:Default
Gui, -Caption +ToolWindow +LastFound +Disabled
Gui2ID := WinExist()
Gui, Margin, 0, 0
Gui, Color, Black
Gui, Add, Pic, HwndCursorID vCursor AltSubmit +BackgroundTrans, %Fadenkreuz%
GuiControlGet, P, Pos, Cursor
DY := (PH // 2) - Y
DX := (PW // 2) - X
WinSet, TransColor, Black
DllCall("SetParent", "Uint", Gui2ID, "Uint", Gui1ID)
Gui, 1:Show, , AHK Game Demo
Gui, 2:Show, NA
DLLCall("ShowCursor", Uint, ShowCursor:=False)
Sleep, 50
MouseMove, (X//2)+(W//2)+1, (Y//2)+(H//2)+1
Return
; ------------------------------------------------------------------------------
GuiClose:
GuiEscape:
Exitapp
; ------------------------------------------------------------------------------
MouseMove(W, L, M, H) {
   Local GX, GY, MX, MY
   Critical
   If (ShowCursor)
      DLLCall("ShowCursor", UInt, ShowCursor:=False)
   WinGetPos, GX, GY, , , ahk_id %Gui1ID%
   MX := L & 0xFFFF
   MY := L >> 16
   WinMove, ahk_id %Gui2ID%,  , MX+GX-DX, MY+GY-DY
}
; ------------------------------------------------------------------------------
NCMouseMove() {
   Global
   Critical
   If (!ShowCursor)
      DLLCall("ShowCursor", UInt, ShowCursor:=True)
}
; ------------------------------------------------------------------------------
MouseClick(W, L, M, H) {
   Local MX, MY
   MX := L & 0xFFFF
   MY := L >> 16
   ToolTip, Mausklick! ; MX+X, MY+Y
   SetTimer, ToolTipOff, -1000
}
; ------------------------------------------------------------------------------
ToolTipOff:
ToolTip
Return
; ------------------------------------------------------------------------------
ExitHandler:
Exitapp

Posted Image
"Man's quest for knowledge is an expanding series whose limit is infinity"