Quick-start guide on how to get up and running quickly and easily The main reason why T.A.R.B.S. engine is different from other engines is due to the limitations. It isn't limited at all. T.A.R.B.S. engine doesn't limit you with GUI or story-line. You aren't even required to build a story. That's all up to you. T.A.R.B.S. engine provides all of the functionality, all you have to do is the easy part. You just need to call the functions.
First, you need to import the module.
An important step in software development is debugging. Luckily, T.A.R.B.S. comes with a debugger. We can enable it by setting the
TARBSengine.debug variable to true. We can also enable logging by calling the
TARBSengine.debug = TrueTARBSengine.enable_logging = True
T.A.R.B.S. comes with some default output so you don't have to manually program each output after calling a function. If you'd prefer, you could leave it disabled, but for this project, I'm going to enable it
TARBSengine.use_default_output = True
Next, you need to create a player instance from the Player class
To do that, you need four arguments: name, HP, minimum Attack damage, and maximum attack damage.
player = TARBSengine.Player("Steven", 20, 5, 10)
Now, we can create an enemy from the Enemy class.
For the enemy class, you will need only four arguments: name, HP, (this is the same as maximum HP.) (This is because enemies cannot heal as of now) minimum Attack damage, and maximum attack damage.
zombie = TARBSengine.Enemy("Dave the Zombie", 11, 5, 10)
We have an enemy. Let's give him a purpose. His purpose is to defend a princess. We need a princess though. For that, we will use the
princess = TARBSengine.NPC("The Princess")
Now, lets attack Dave. We can do that by calling the
Let's have Dave attack the player now. That can be done with the
Thanks to debugging, we can see exactly how much damage the attack did and how much HP the player has left. Let's attack Dave one more time.
Dave is dead. We can now talk to the princess. The princess is going to give us something. We can create a potion using the
Potion class. Let's make a healing potion.
magic_potion = TARBSengine.Potion("Magic Health Potion", 5)
Now, let's make the Princess talk to us and give us the potion. We can do that by using the
NPC.talkto() function in the
princess.talkto("Thank you for saving me", True)
Now, let's edit the player's inventory to add a potion.
princess.talkto("You look hurt, here is a magic potion to heal you", True)player.additem(magic_potion, 1)
Now that the player has the magic potion, let's use the
Player.usepotion() function to drink the potion and heal.
Here is the full code if you want to copy it:
import TARBSengineTARBSengine.debug = TrueTARBSengine.enable_logging = TrueTARBSengine.use_default_output = TrueTARBSengine.initlogging()player = TARBSengine.Player("Steven", 20, 20, 5, 10)zombie = TARBSengine.Enemy("Dave the Zombie", 11, 5, 10)princess = TARBSengine.NPC("The Princess")player.atk(zombie)zombie.atk(player)player.atk(zombie)magic_potion = TARBSengine.Potion("Magic Health Potion", 5)princess.talkto("Thank you for saving me", True)princess.talkto("You look hurt, here is a magic potion to heal you", True)player.additem(magic_potion, 1)player.usepotion(magic_potion)
That basic information should be enough to get a simple game up and running. If you would like to learn more about the engine, you can read about it here.