Playable game list:
Pong by Devenger
Snake by Fuzzylightning
Tetris by Fuzzylightning
Rock Attack by Nevec
Something I thought of a very long time ago, did a while ago with input and support from RabidToaster, and never got round to releasing until now was Toolgun Minigames. Quite simply, the ability to play games on your toolgun screen, wherever you are - it's clientside, so all it relies on is having a toolgun to hand.
WARNING TO GENERAL PLAYERS: there's a reason that this is in the Lua Scripting forum and not Releases. Though there is fun to be had with this, this is NOT a finished product.
There's four playable minigames so far. It really isn't hard to make a minigame if you have experience with Lua, so please do mess around - Pong serves as a good example of a simple game, and the 'base' game is commented with explanations or all special functions the toolgun will call on games.
Games are as easy to make as they'll ever be - similar to SWEPs, games need to have an appropriately named folder with an init.lua file inside to load, and have functions you can define which will call in certain situations - Initialize, Think, Render, Pause, et cetera. Games can be made of as many files as you want, you can just include additional ones as you would in any script (though Pong only has one file, MP Draughts has 6). Any games defined in themselves as 'selectable' are automatically entered into the game select menu, which is just another game that the toolgun loads first when you enter minigame mode.
- Get the latest version via SVN. There's details about checkout on the google code project: toolgunminigames. Check it out into garrysmod/addons/toolgun_minigames.
Extract to garrysmod/addons.
- Load up GMod, and bind a key to 'tgm_toggle' (e.g. bind 'l' 'tgm_toggle') - this key will then bring the toolgun up to your screen, if you have the toolgun out, so you can play minigames, and another press will put the toolgun back into normal operation mode.
- Play any of the four completed games. In console, put 'tgm_showunfinishedgames 1' to have the game select menu show all games, including the ones that don't work (you may have to press USE - 'return to game select' - to refresh the game select menu).
- Come back, give me constructive criticism and suggestions for games or other features.
Commands Reference Guide:
tgm_toggle - toggle whether toolgun is in minigame mode
tgm_alwaysrender 0/1 - set whether the active minigame should render on the toolgun screen even when the toolgun is in normal operation mode
tgm_showunfinishedgames 0/1 - for developers only, or people who want to play unfinished Breakout - when on, the game select menu will populate itself with all games when initialized, not just ones that want to be selectable
tgm_reloadgames - another developer one; reloads all games so you can rapidly test changes you've saved to game files.
tgm_initialize - not recommended: reload the addon entirely, shouldn't be neccessary
Devenger: idea, core coding, Pong
RabidToaster: saying it was cool, additional ideas, testing
Fuzzylightning: 'Snake' game, 'Tetris' game
Nevec: 'Rock Attack' game
Got ideas? Say them! Like this so far? Say so!