Categories
development infernusrpg

Applying game programming patterns to infernusRPG

Continued with development of infernusRPG https://github.com/blockcha1n444/infernusrpg

This time i have begin to apply the game programming pattern Type Object http://gameprogrammingpatterns.com/type-object.html my goal it’s having a reusing file library of JSON enemies types.

Like this:

var types = {"enemies":[{	
	"name": "Bat",
	"hp": 10,
	"speed": 90,
	"strength": 1,
	"dexterity": 6,	
	"attack":"The Bat bites you"}
	,{
	"name": "Ghost",
	"hp": 25,
	"speed": 25,
	"strength": 4,
	"dexterity": 4,	
	"attack":"The Ghost hits you"	}
	,{
	"name": "Zombie",
	"hp": 50,
	"speed": 79,
	"strength": 5,
	"dexterity": 1,	
	"attack":"The Zombie bites you"	}
	,{
	"name": "Troll",
	"hp": 60,
	"speed": 40,
	"strength": 7,
	"dexterity": 4,	
	"attack":"The Troll throws a strong hit"	}
	]
}

This is a dictionary in gdscript that has the same sintax that JSON