Making game with AHK (NOT solved)

Ask gaming related questions
User avatar
Hajin
Posts: 32
Joined: 13 May 2016, 09:16

Making game with AHK (NOT solved)

13 May 2016, 09:46

I want to know:

- The way to put scrolling effects in large images like in platform games
- Resize images automatically with size of the window resized in middle of script's operation

This guy made those things but i think he not made his game with external images:
https://autohotkey.com/board/topic/7838 ... platformer

I think i will make an game with external images like in this script for example:

Code: Select all

;(o)image movement, sound, file path, text, save/load
;( )scrolling, auto resize images with window

#NoEnv  ; Recommended for performance and compatibility with future AutoHotkey releases.
#Persistent
SendMode Input  ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir%  ; Ensures a consistent starting directory.

IniRead, x, Filename, a, x , 20
IniRead, y, Filename, a, y , 100

Gui, +Resize
Gui, Add, Picture, vpic
Gui, Add, Picture, vpic2
GuiControl,, pic,%A_WorkingDir%\background.png
GuiControl,, pic2,%A_WorkingDir%\character.gif
Gui, Show, w1000 h700 xCenter y0,
GuiControl, Move, Pic2, % "x" x "y" y
loop
{
	if GetKeyState("right", "P")
	{
		x += 20
		GuiControl, Move, Pic2, % "x" x "y" y
		SoundPlay, %A_WorkingDir%\sound.mp3
		SoundPlay *-1
		Sleep, 50
	}
	if GetKeyState("q", "P")
	{
		break		
	}
	if GetKeyState("w", "P")
	{	
		IniWrite, %x%, Filename, a, x	
		IniWrite, %y%, Filename, a, y
	}
}
return
GuiClose:
ExitApp
Last edited by Hajin on 30 May 2016, 08:07, edited 3 times in total.
____________________________________________________________________________________

Can anyone help me here?
https://autohotkey.com/boards/viewtopic ... 18&t=17798

My Scripts In This Forum:
____________________________________________________________________________________
User avatar
TheDewd
Posts: 1323
Joined: 19 Dec 2013, 11:16
Location: USA

Re: Making game with AHK

13 May 2016, 15:13

I worked on a game in AHK once... I have since abandoned the project, but you may be able to get inspiration from it...

https://autohotkey.com/boards/viewtopic.php?t=7348
Image Bulldozer - Sokoban inspired game from 1994 recreated in AutoHotkey.
User avatar
Hajin
Posts: 32
Joined: 13 May 2016, 09:16

Re: Making game with AHK

13 May 2016, 15:30

Interesting ... "downloaded times +1" :+1:
____________________________________________________________________________________

Can anyone help me here?
https://autohotkey.com/boards/viewtopic ... 18&t=17798

My Scripts In This Forum:
____________________________________________________________________________________
Helgef
Posts: 3898
Joined: 17 Jul 2016, 01:02
Contact:

Re: Making game with AHK (NOT solved)

24 Jul 2016, 08:11

Hajin wrote:I want to know:

- The way to put scrolling effects in large images like in platform games
I made you and example game, it scrolls a background and moves a player, use left and right arrows.
Put all files in same folder and run, Esc::ExitApp

Code:
Spoiler
Please verify that platform.png is 3382x448 pixels and mushy4.gif is 64x64. Other wise I need to find an alternate upload.

mushy.rar
mushy.ahk, mushy4.gif, platform.png
(10.63 KiB) Downloaded 119 times

Edit: Fixed attachments, now in rar because images were scaled.
User avatar
Hajin
Posts: 32
Joined: 13 May 2016, 09:16

Re: Making game with AHK (NOT solved)

24 Jul 2016, 21:25

Looks good :), after some things i will test this script...
I'm making a game with other system, currently.
I still have interest in make game with AHK...
AHK is very interesting.
____________________________________________________________________________________

Can anyone help me here?
https://autohotkey.com/boards/viewtopic ... 18&t=17798

My Scripts In This Forum:
____________________________________________________________________________________

Return to “Gaming”

Who is online

Users browsing this forum: No registered users and 8 guests