Create new file, call it
empitest.rb or something like that and put this content into it:
require 'empi'
Empi::GameWindow.initializeCalling
ruby empitest.rb from command line in the folder you create that little file should run it. Press "h" for ingame help.
---
I have added building of new units. But because new units were told to note class Map where are they located, freshly created units in fact managed to
entirely delete the town that created them. So I needed to store these new units somewhere. So I got to another thing that would I need to get to one way or another anyway: transporting of other units. One of core elements of gameplay should be managing of your transport ships because there rarely be dry way connecting all parts of map. So now towns put new units into their inventory (tested), units next to town can go through town (tested) and even those (in testing maps so far unused) ships should be able to carry other units (not tested yet).
I have never made a gem before. The biggest trouble was not in fact the building and uploading of gem itself but pathing. I have been always running the game from its main folder so "current folder" was the same as "game folder". But when I installed the game and tried to run it my relative links to images and saves files broke. Thus full absolute paths are used now. But figuring it took me from core 0.16 up to 0.16.6.
v16 dev
=========
- units on sentry duty say so when functioning
- neutral units can't have functions
- links to media and save files use full path
- towns build armies
fixed: no building of units
! hardcoded unit type to be built
- units can transport other units
- newly built units are stored in town instead of map
fixes: new units are saved in map instead of the towns that built them
! transported units are not drawn
! transported units show info of their transport instead when selected
! all units can capture and visit towns
file changes
--------------
map
initialize() uses full paths to files
all_units renamed to all_map_units() - Return only units directly on map
+all_transported_units() - Return only units transported by other units
+all_units() - Return both map units and transported units
draw_units() draws only map units
unit
+@cargo, @cargo_max
+can_transport?() - Unit is able to both transport other units and currently has some space left
set_function() checks for @faction == 0
checking of movement separated from update()
+check_movement() - Processes move of unit and takes care of its (un)loading or attack
capture() makes newly captured towns start building
town
initialize() uses full path to file
+parts_built
+@cargo_max set to 10
army
initialize() uses full path to file
ship
initialize() uses full path to file
+@cargo_max set to 3
unitFunction
+FUNCBUILD case in func!()
FUNCSENTRY case in func!() sets "ret" even when unit keeps sentrying
TODO
===========
old wishes
! no panning of map
!x no destruction of units
!x no building of units
! no victory conditions
! attacker always wins
! player playing both factions at once
!x hardcoded starting scenario
! no fog of war
! no saving
!x no loading
! no title screen
! no highscore screen
! no settings
! no sound, no music
new problems
! hardcoded save file name
! hardcoded map size
! hardcoded unit type to be built
! transported units are not drawn
! transported units show info of their transport instead when selected
! all units can capture and visit towns
(! thing to fix, !x fixed thing)