[game/class] Tower Defense example
[game/class] Tower Defense example
I have a class designed for creating simple games with ahk using direct2d and recently wanted to update it, so I also quickly created a tower defense example and though it would be fun to share here as well!
It is not a full game but rather a small example to show class usage, as such some things unique to tower defense style games will not be present
The class and code for this example can be found on the github page here -> Game Class
You may also find my other 2 classes, Image/Pixel Scanning and Overlay Class useful as well =)
It is not a full game but rather a small example to show class usage, as such some things unique to tower defense style games will not be present
The class and code for this example can be found on the github page here -> Game Class
You may also find my other 2 classes, Image/Pixel Scanning and Overlay Class useful as well =)
Some of my AHK programs: 3D Voxel Game - Platformer Game
GitHub projects : Image/Pixel scanning class - Direct2D overlay class
GitHub projects : Image/Pixel scanning class - Direct2D overlay class
-
- Posts: 934
- Joined: 30 Sep 2017, 03:59
- Location: Romania
- Contact:
Re: [game/class] Tower Defense example
This is amazing! Thank you for sharing this!!
-------------------------
KeyPress OSD v4: GitHub or forum. (presentation video)
Quick Picto Viewer: GitHub or forum.
AHK GDI+ expanded / compilation library (on GitHub)
My home page.
KeyPress OSD v4: GitHub or forum. (presentation video)
Quick Picto Viewer: GitHub or forum.
AHK GDI+ expanded / compilation library (on GitHub)
My home page.
- FanaticGuru
- Posts: 1908
- Joined: 30 Sep 2013, 22:25
Re: [game/class] Tower Defense example
What you do with graphics in AHK is impressive.
I always enjoy your AHK code and videos. The more the better!
FG
I always enjoy your AHK code and videos. The more the better!
FG
Hotkey Help - Help Dialog for Currently Running AHK Scripts
AHK Startup - Consolidate Multiply AHK Scripts with one Tray Icon
Hotstring Manager - Create and Manage Hotstrings
[Class] WinHook - Create Window Shell Hooks and Window Event Hooks
AHK Startup - Consolidate Multiply AHK Scripts with one Tray Icon
Hotstring Manager - Create and Manage Hotstrings
[Class] WinHook - Create Window Shell Hooks and Window Event Hooks
- SpeedMaster
- Posts: 494
- Joined: 12 Nov 2016, 16:09
Re: [game/class] Tower Defense example
The game works very well (Win 7 & 10).
Thanks for sharing.
Thanks for sharing.
Re: [game/class] Tower Defense example
Glad you guys find it interesting =P
Thanks for the feedback @SpeedMaster, always nice to know that it's working as intended, especially since I didn't have a windows 7 machine to ever test the class on.
Thanks for the feedback @SpeedMaster, always nice to know that it's working as intended, especially since I didn't have a windows 7 machine to ever test the class on.
Some of my AHK programs: 3D Voxel Game - Platformer Game
GitHub projects : Image/Pixel scanning class - Direct2D overlay class
GitHub projects : Image/Pixel scanning class - Direct2D overlay class
Re: [game/class] Tower Defense example
+1 to every comment so far, impressive work!
-
- Posts: 934
- Joined: 30 Sep 2017, 03:59
- Location: Romania
- Contact:
Re: [game/class] Tower Defense example
@Spawnova : How do you obtain the vTable numbers for the D2D method interfaces? Do you look in .h files or?
I would be interested in extending the overlay class with more tools.
I would be interested in extending the overlay class with more tools.
-------------------------
KeyPress OSD v4: GitHub or forum. (presentation video)
Quick Picto Viewer: GitHub or forum.
AHK GDI+ expanded / compilation library (on GitHub)
My home page.
KeyPress OSD v4: GitHub or forum. (presentation video)
Quick Picto Viewer: GitHub or forum.
AHK GDI+ expanded / compilation library (on GitHub)
My home page.
Re: [game/class] Tower Defense example
Correct! I look in the .h files to get their index and params, it is hard to add some stuff though because I want to keep it as user friendly as possible and certain things require specific setups so it takes some extra thought in how to achieve something but still have it be somewhat intuitive to use =Probodesign wrote: ↑03 Mar 2023, 15:07@Spawnova : How do you obtain the vTable numbers for the D2D method interfaces? Do you look in .h files or?
I would be interested in extending the overlay class with more tools.
Some of my AHK programs: 3D Voxel Game - Platformer Game
GitHub projects : Image/Pixel scanning class - Direct2D overlay class
GitHub projects : Image/Pixel scanning class - Direct2D overlay class
- FanaticGuru
- Posts: 1908
- Joined: 30 Sep 2013, 22:25
Re: [game/class] Tower Defense example
Did you code a tool to create the cracked rock track? It would be cool to attempt to automate that tool to attempt to generate random level backgrounds if you used code to generate it.
Also, did you ever post the code for you platformer demo: https://www.youtube.com/watch?v=IxSKNPaMb7s&t=145s
That would be great to see.
You got several demos that are right on the verge of being full fletch games. But I get it, once you figure out the interesting stuff the easy stuff to polish it into a complete game is not as interesting. I mean to turn this into a full game is pretty much just a dozen more towers, a dozen more enemies, and a 100 levels. With some campaign elements. But all that is somewhat repetitive to code. Making a random level generator could be interesting though.
FG
Also, did you ever post the code for you platformer demo: https://www.youtube.com/watch?v=IxSKNPaMb7s&t=145s
That would be great to see.
You got several demos that are right on the verge of being full fletch games. But I get it, once you figure out the interesting stuff the easy stuff to polish it into a complete game is not as interesting. I mean to turn this into a full game is pretty much just a dozen more towers, a dozen more enemies, and a 100 levels. With some campaign elements. But all that is somewhat repetitive to code. Making a random level generator could be interesting though.
FG
Hotkey Help - Help Dialog for Currently Running AHK Scripts
AHK Startup - Consolidate Multiply AHK Scripts with one Tray Icon
Hotstring Manager - Create and Manage Hotstrings
[Class] WinHook - Create Window Shell Hooks and Window Event Hooks
AHK Startup - Consolidate Multiply AHK Scripts with one Tray Icon
Hotstring Manager - Create and Manage Hotstrings
[Class] WinHook - Create Window Shell Hooks and Window Event Hooks
Re: [game/class] Tower Defense example
@FanaticGuru I used gimp to create everything, although implementing a track editor wouldn't be too hard, but you are right I generally like to learn a bunch of stuff rather than commit to making a full experience.
I never released source on the older stuff because the way it was coded was not very intuitive, messy and hard to follow (I never use comments in my own personal code XD)
But that's why the only 3 classes I made public I try very hard to make sure it's easy for people to understand and use, and I plan to keep expanding on them as I learn new things, it's pretty fun =P
I never released source on the older stuff because the way it was coded was not very intuitive, messy and hard to follow (I never use comments in my own personal code XD)
But that's why the only 3 classes I made public I try very hard to make sure it's easy for people to understand and use, and I plan to keep expanding on them as I learn new things, it's pretty fun =P
Some of my AHK programs: 3D Voxel Game - Platformer Game
GitHub projects : Image/Pixel scanning class - Direct2D overlay class
GitHub projects : Image/Pixel scanning class - Direct2D overlay class
- FanaticGuru
- Posts: 1908
- Joined: 30 Sep 2013, 22:25
Re: [game/class] Tower Defense example
I have played around with your 3 classes on GitHub and they are pretty easy to use. An average user can get a lot of effect with little knowledge. The classes take care of all the rendering complexity and the user is left with mostly just what I would call clever math to design good looking effects. Like your rain demo, a little math and boom, nice rain effect.
On several of the examples though, you had the 'overlay' defined as 'clickThrough' which made it difficult to make the window active, which caused none of the hotkeys or dragging to work.
Also, nice to see the Game class converted to v2, hopefully you will convert the Overlay and Scan to v2 also.
FG
Hotkey Help - Help Dialog for Currently Running AHK Scripts
AHK Startup - Consolidate Multiply AHK Scripts with one Tray Icon
Hotstring Manager - Create and Manage Hotstrings
[Class] WinHook - Create Window Shell Hooks and Window Event Hooks
AHK Startup - Consolidate Multiply AHK Scripts with one Tray Icon
Hotstring Manager - Create and Manage Hotstrings
[Class] WinHook - Create Window Shell Hooks and Window Event Hooks
Re: [game/class] Tower Defense example
Oh thanks for that, I changed around the initial params sometime after making those early examples and forgot to update them thereFanaticGuru wrote: ↑04 Mar 2023, 21:32On several of the examples though, you had the 'overlay' defined as 'clickThrough' which made it difficult to make the window active, which caused none of the hotkeys or dragging to work.
The other 2 classes will be converted to v2 as well pretty soon here, I'm still learning the new syntax myself =P
Some of my AHK programs: 3D Voxel Game - Platformer Game
GitHub projects : Image/Pixel scanning class - Direct2D overlay class
GitHub projects : Image/Pixel scanning class - Direct2D overlay class