![]() The position is a Vector2, this has a x and y value and denotes the hero position on the map, the initial position is passed as a variable (pos) to the class. The public constructor for our hero class sets the type to the newly defined HERO, we set the dimensions, texture, speed and position. Hero = new Texture("entities/hero/hero.png") This new enum type and speed can be added to Entity as class variables:Īdd the hero image to a new folder “assets/entities/hero/hero.png”Īdd a new Texture to this class and in the load_assets function initialise it: ![]() We will need to change the keyboard inputs to move the Hero Entity and have the camera follow them.Ī new enum is needed for entities, for now we only have one type of HERO: The hero will need a new class that extends Entity, it will need a new texture and ENUM type. ![]() Most games will have a main character or a hero, for the moment ours will be this little person, they can be replaced later if necessary. Making a LibGDX Game – Part 14 – Firing Bullets #gamedevĬarelesslabs on Hacking my baby cam (Motorola…Ĭarelesslabs on Making a LibGDX Game – P…Ībhishek Prasad on Hacking my baby cam (Motorola…. ![]() ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |