[Game] Bulldozer

Post your working scripts, libraries and tools for AHK v1.1 and older
User avatar
TheDewd
Posts: 1503
Joined: 19 Dec 2013, 11:16
Location: USA

[Game] Bulldozer

05 Jun 2018, 09:42

Introduction
Bulldozer, developed for AutoHotkey by Weston Campbell (TheDewd), is a recreation of the original Bulldozer game series created by John 'FlyMan' Hattan (The Code Zone).

Bulldozer 1 first appeared in 1994 on the CD-ROM game compilation "24 Games for Windows 95" developed by The Code Zone for Expert Software, Inc. Bulldozer 2 became available in 2000 on "Arcade Magic", also developed for Expert Software, Inc. Bulldozer 1 & Bulldozer 2 were re-released in 2003 on "Blazing Games", a compilation of fifty games developed for Cosmi Europe, Ltd. Bulldozer 3 was completed in 2002, but remained unavailable until the 2008 release of Bulldozer which included all 180 levels from the Bulldozer trilogy. The 2008 version was created using Adobe Flash and is available on a variety of desktop and mobile platforms. Bulldozer is a variation of the popular Sokoban puzzle game.

All credit goes to John Hattan for the original idea of the Bulldozer game series. This project was an exercise in GDI+ and string manipulation, and is intended to pay tribute to the game I played in my youth.


NOTE: The game script has changed drastically since it's earliest releases. Many of the replies to this post may be referencing an earlier build of the game or features that no longer exist. I apologize for any confusion that may occur if you read the earlier replies.


Image


Website Links:

Image GitHub: https://github.com/westoncampbell/BulldozerAHK

Image AutoHotkey: https://www.autohotkey.com/boards/viewtopic.php?f=6&t=50139



Download
Latest Release: Revision 18 (2019-05-09) (GitHub)

Image All releases can be found on the BulldozerAHK GitHub repository.



Screenshots
Image Image Image Image Image Image Image Image Image



Game Objective
The object of Bulldozer is to push each rock on to a target.



Movement
Move the bulldozer using the arrow keys, or WASD keys, on your keyboard. The bulldozer can move horizontally and vertically.

Image

The bulldozer will not move if one of the following three conditions are true:

(1) You are trying to push multiple rocks...

Image

You can only push one rock at a time!

(2) You are pushing against a wall...

Image

The bulldozer can't move through walls.

(3) You are pushing a rock against a wall...

Image

Be careful about pushing rocks against walls. The rock might become stuck, and you'll be forced to restart the level.

Image

However, it may still be possible to reach the target depending on its position.

Image



Completing a Level
Progress to the next level by moving all of the rocks on to the targets. Each level will have the same number of rocks as targets.



Hints
Carefully plan your moves. It's easy to get stuck which may force you to restart the level.

A rock is not locked into position once it is placed on a target.



Menubar
Game

Restart Level
Reset the level, moving all of the objects to their original starting positions.

Level Select
Show the level selection screen, allowing navigation to any of the included 180 levels.

Undo Last Move
Reset all objects from your recent move to their previous positions.

Exit
Completely close the game.

View

Layered Tiles
Toggle drawing of objects on top of the background elements for custom themes using transparency. Depending on the custom theme, "Layered Tiles" may improve the appearance of the tiles.

Options

Background Color
Set the color of the background behind the game objects by choosing from one of the 16 presets or using the custom color picker.

Theme
Change the appearance of the game objects by choosing the "Color" or "Monochrome" options, or using a custom theme by selecting an external PNG image file.

Sound Effects
Toggle sound effects.

Level Number
Toggle the display of the current level number overlayed on the top-right of the game screen.

Unlimited Undo
Toggle the allowance of multiple consecutive undo actions.

Mouse Movement
Toggle the movement of the bulldozer using mouse controls.

Titlebar Progress
Toggle the display [Text] of the current level progress in the titlebar of the game window.

Taskbar Progress
Toggle the display [ProgressBar] of the current level progress in the game taskbar item.

Help

Website...
Open the game website in the default web browser.

Documentation...
Open the game documentation file.

About Bulldozer
Open the 'About' screen, displaying information related to the current version of the game.


Custom Themes
Bulldozer supports loading custom themes from an external 480x32 PNG image file.

Each 32x32 region represents one of the 15 tiles in the game.

Image

Use an image editor to create a new theme, or choose from any of the available themes from the Bulldozer website.

Image Submit your custom theme images to have them included on the Bulldozer website! Image



Hotkeys
Several actions in the game can be triggered using a hotkey. See below for a complete list of active hotkeys:

Code: Select all

Description						Area					Hotkey
================================================================================
Restart Level					Game 					F2
--------------------------------------------------------------------------------
Show 'Level Select' 			Game,					F3
								About
--------------------------------------------------------------------------------
Save Screenshot 				Game 					F12
--------------------------------------------------------------------------------
Load Previous Level 			Game 					PgUp
--------------------------------------------------------------------------------
Load Next Level 				Game 					PgDn
--------------------------------------------------------------------------------
Hide Screen 					Game 					Esc
--------------------------------------------------------------------------------
Move Up 						Game 					↑, W, Left Mouse
--------------------------------------------------------------------------------
Move Left 						Game 					←, A, Left Mouse
--------------------------------------------------------------------------------
Move Down 						Game 					↓, S, Left Mouse
--------------------------------------------------------------------------------
Move Right 						Game 					→, D, Left Mouse
--------------------------------------------------------------------------------
Exit Game 						Game,					Alt+F4
								Level Select,
								About Bulldozer
--------------------------------------------------------------------------------
Minimize Game 					Game,					Space
								Level Select,
								About Bulldozer
--------------------------------------------------------------------------------
Default Action 					About Bulldozer,		Enter
								Level Select
--------------------------------------------------------------------------------
Show 'About Bulldozer' 			Game,
								Level Select 			F1
--------------------------------------------------------------------------------
Select Previous Level 			Level Select 			↑, ←
--------------------------------------------------------------------------------
Select Next Level 				Level Select 			↓, →
--------------------------------------------------------------------------------
Select Previous Level (x5)		Level Select 			PgUp
--------------------------------------------------------------------------------
Select Next Level (x5) 			Level Select 			PgDn
--------------------------------------------------------------------------------
Select First Level 				Level Select 			Home
--------------------------------------------------------------------------------
Select Last Level 				Level Select 			End
--------------------------------------------------------------------------------
Load Selected Level 			Level Select 			Enter
--------------------------------------------------------------------------------
Last edited by TheDewd on 21 May 2019, 11:35, edited 133 times in total.
User avatar
Nextron
Posts: 1391
Joined: 01 Oct 2013, 08:23
Location: Netherlands OS: Win10 AHK: Unicode x32

Re: [GAME] Bulldozer

05 Jun 2018, 09:47

TheDewd wrote:Please share any suggestions for improvement!
Pics! :monkeysee:
User avatar
TheDewd
Posts: 1503
Joined: 19 Dec 2013, 11:16
Location: USA

Re: [GAME] Bulldozer

05 Jun 2018, 09:51

Nextron wrote:
TheDewd wrote:Please share any suggestions for improvement!
Pics! :monkeysee:
Updated first post with screenshot. I plan to add more information later. I just wanted to go ahead and share the game so far.
User avatar
jeeswg
Posts: 6902
Joined: 19 Dec 2016, 01:58
Location: UK

Re: [GAME] Bulldozer

05 Jun 2018, 10:50

- Game looks phenomenal cheers. The 2 things to mention are that it flashes black each time you move, and that you can't hold down the arrow keys, you have to press repeatedly. But all of the key stuff is done, cheers again.
homepage | tutorials | wish list | fun threads | donate
WARNING: copy your posts/messages before hitting Submit as you may lose them due to CAPTCHA
User avatar
TheDewd
Posts: 1503
Joined: 19 Dec 2013, 11:16
Location: USA

Re: [GAME] Bulldozer

05 Jun 2018, 11:10

jeeswg wrote:it flashes black each time you move
You're correct! The issue only occurs for me when using the classic Windows interface. On Windows 7/Windows 10 using themed interface the issue is non-existent. I'm currently implementing a working solution to this for the next update by using BitBlt.
jeeswg wrote:you can't hold down the arrow keys, you have to press repeatedly
I disabled the repeat initially to allow the script time to fully update the background image and other things so that the player doesn't notice the "lag" between updates.
Last edited by TheDewd on 05 Jun 2018, 22:32, edited 1 time in total.
need4speed
Posts: 143
Joined: 22 Apr 2016, 06:50

Re: [GAME] Bulldozer

05 Jun 2018, 15:57

wow, impressive. :thumbup:
you could add an small animation and play a sound when a level is completed.
User avatar
SpeedMaster
Posts: 494
Joined: 12 Nov 2016, 16:09

Re: [GAME] Bulldozer

05 Jun 2018, 19:44

Nice and concise game script. :thumbup:
The game plays well on windows 7 (no flickering background exept on windows 10)
This game is almost identical to the original. :clap:
Thanks for sharing.
tmplinshi
Posts: 1604
Joined: 01 Oct 2013, 14:57

Re: [GAME] Bulldozer

06 Jun 2018, 01:09

It's getting harder for me from level 10, then I look at how many levels.. 61 maps! oh no.. you are wasting my time.. Nice script.

No flickering background on windows 10 x64.
Helgef
Posts: 4709
Joined: 17 Jul 2016, 01:02
Contact:

Re: [GAME] Bulldozer

06 Jun 2018, 02:51

Impressive stuff :shock: :clap: . Less impressive, I failed level 2 twice :facepalm:

Thanks for sharing, cheers.
User avatar
nnnik
Posts: 4500
Joined: 30 Sep 2013, 01:01
Location: Germany

Re: [GAME] Bulldozer

06 Jun 2018, 02:55

I have yet to completely read the entire source but it looks promising.
You should probably rather draw an entire picture and display the whole game as one picture instead of using seperate picture controls.
Recommends AHK Studio
User avatar
derz00
Posts: 497
Joined: 02 Feb 2016, 17:54
Location: Middle of the round cube
Contact:

Re: [GAME] Bulldozer

06 Jun 2018, 06:39

excuse my ignorance of games, but what does this password do?
try it and see
...
User avatar
TheDewd
Posts: 1503
Joined: 19 Dec 2013, 11:16
Location: USA

Re: [GAME] Bulldozer

06 Jun 2018, 06:53

derz00 wrote:excuse my ignorance of games, but what does this password do?
There is a "Level Select" menu item in the "Game" menu in the menubar, or press F3. Enter the password to load a specific level.
User avatar
derz00
Posts: 497
Joined: 02 Feb 2016, 17:54
Location: Middle of the round cube
Contact:

Re: [GAME] Bulldozer

06 Jun 2018, 07:12

OK that makes sense :)

Good job on the game. Level 6 took me about 6-8 tries. The rest were pretty easy except I lost my motivation at level 10 :) Now I wish I had noted the password for that level.
try it and see
...
User avatar
TheDewd
Posts: 1503
Joined: 19 Dec 2013, 11:16
Location: USA

Re: [GAME] Bulldozer

07 Jun 2018, 16:12

Updated: Background flicker should now be eliminated.

Revision 3 (2018-06-07)
  • Changed background image update process to prevent flickering
just me
Posts: 9406
Joined: 02 Oct 2013, 08:51
Location: Germany

Re: [GAME] Bulldozer

08 Jun 2018, 05:04

Just one more: "Impressive, thanks for sharing!"

Your script doesn't run on AHK Basic. So you don't need those (A_PtrSize ? "UPtr" : "UInt"). You can safely use "UPtr" or "UPtr*/"UPtrP".

Some thoughts on BackgroundLoad():
  • As far as i can see the tile images will never be changed. So you need to load them into pTilemap only once when the script starts or the tile map will be changed (e.g. in OnLoad()) and destroy the current tile map in OnUnload().
  • Also, you can reuse the GDIP background image and its graphics. They also can be created in OnLoad() and destroyed in OnUnload(). (This would even allow to update only the tiles of interest, 3 at most.)
  • Code: Select all

    	; Create brush
    	DllCall("Gdiplus.dll\GdipCreateSolidFill", "UInt", 0XFF808000, (A_PtrSize ? "UPtr*" : "UInt*"), pBrush)
    	; Fill bitmap graphic with brush color
    	DllCall("Gdiplus.dll\GdipFillRectangle", (A_PtrSize ? "UPtr" : "UInt"), G, (A_PtrSize ? "UPtr" : "UInt"), pBrush, "Float", 0, "Float", 0, "Float", 640, "Float", 384)
    	; Delete brush
    	DllCall("Gdiplus.dll\GdipDeleteBrush", (A_PtrSize ? "UPtr" : "UInt"), pBrush)
    
    might be replaced by

    Code: Select all

       DllCall("Gdiplus.dll\GdipGraphicsClear", "Ptr", G, "UInt", 0XFF808000)
brutus_skywalker
Posts: 175
Joined: 24 Dec 2016, 13:16
Location: Antarctica

Re: [GAME] Bulldozer

09 Jun 2018, 10:58

You Sir Most Certainly Are TheDewd , FREAKING AWESOME DUDE!
Outsourcing Clicks & Presses Since 2004.
User avatar
Gio
Posts: 1247
Joined: 30 Sep 2013, 10:54
Location: Brazil

Re: [GAME] Bulldozer

09 Jun 2018, 13:04

Nice script, thanks for sharing :D

The level-select password system seems to be not working here. Rev 3. Windows 8.1 Single Language (64 bits).
User avatar
TheDewd
Posts: 1503
Joined: 19 Dec 2013, 11:16
Location: USA

Re: [GAME] Bulldozer

11 Jun 2018, 23:59

Revision 4 (2018-06-11)
  • Added levels from Bulldozer 2 and Bulldozer 3
  • Resized level area for compatibility with maps from Bulldozer 2/Bulldozer 3
  • Optimized level drawing to update changed tiles only
  • Redesigned 'Level Select' and 'About' menu item contents
Note: The passwords are different from the previous versions due to changing the formatting of the level data for compatibility with the larger maps added for levels 61-180. I apologize for any inconvenience.

I hope you all enjoy the game!
burque505
Posts: 1731
Joined: 22 Jan 2017, 19:37

Re: [GAME] Bulldozer

12 Jun 2018, 07:27

:bravo: Wow, what a difference! It's really smooth, no flickering, repeat works great.
Those changes in BackgroundLoad(MapData) worked wonders.
Thanks for sharing this.
Regards,
burque505
User avatar
rommmcek
Posts: 1470
Joined: 15 Aug 2014, 15:18

Re: [GAME] Bulldozer

12 Jun 2018, 14:00

Great, great, great! Very smooth, some constellations are really not too easy!

P.s.: Level 24, wall seems to be rock (not bulldozer alone) permeable at least at coordinats 2,4; 3,6; 4,5; 4,7; where 0,0; being upper left corner.

Return to “Scripts and Functions (v1)”

Who is online

Users browsing this forum: No registered users and 75 guests