development infernusrpg

New item manager in infernusrpg

I continued adding features to infernusrpg, this time i have added a item manager. I have added a new item group and a single item stats as well as a single item scene with its itemscript attached.

In i have added new part in the try_move() func

	#collect items
		var item = _ref_DungeonBoard.get_sprite(_new_GroupName.ITEM, x, y)
		if item!=null:
			print("item collected")

The item manager calls the item instance method collected_by()

func collect(_pc:Sprite,item:Sprite,_group:String ,_x:int,_y:int) -> void:

And the item script pick up the call:

func collected_by(_pc:Sprite) -> void:
	_pc = _pc as PC
	_pc.hp += _new_ChickenStats.RECOVERY_HP
	#set the maximum hp
	if _pc.hp>_new_PCStats.HP:

So every item have their own call to collected_by() then it can increase hp, decrease hp or whatever it wants.

github repository

development infernusrpg

Adding combat system to infernusrpg

The design of the classes for the combat system is as follows:

-library/ stores the constants of the strength,dexterity,hp and speed for each enemy or for the player.

const SPEED: int = 100
const STRENGTH: int = 1
const DEXTERITY: int = 3
const HP: int = 10

-library/ make the calculations for the attack and for roll a dice

func roll(number:int ,type:int  )->int:           
	var acc=0
	for x in range(0,number):                    
		acc += _rng.randi_range(1,type)                 
	return acc

-sprites/ it serves to store some instance variables of each sprite

var ar:int
var dr:int
var hp:int

func _init():

-scenes/main/PCAttack and scenes/main/EnemyAttack make the calls to the combat system


infernusrpg is a rpg turn-based demo game or prototype made in godot. you can download the source code at