Re: BGT dilemma
Re: BGT dilemma Yeah.Ideally it should be encapsulated into a static object or whatever, but lots of people seem to find it difficult to utilize classes. URL: http://forum.audiogames.net/viewtopic.php?pid=350913#p350913 ___ Audiogames-reflector mailing list Audiogames-reflector@sabahattin-gucukoglu.com https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector
Re: BGT dilemma
Re: BGT dilemma It's true that you can Access the string from everywhere but I thought it would be good to explain getter methods since they are often used in larger Projects, especially for Commercial Projects. It was just a Little example how they work. But yes, it is a global variable and so you don't really Need a function for it. URL: http://forum.audiogames.net/viewtopic.php?pid=350802#p350802 ___ Audiogames-reflector mailing list Audiogames-reflector@sabahattin-gucukoglu.com https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector
Re: BGT dilemma
Re: BGT dilemma The Problem is that you put your skill Code in the character_checking function. Instead, alter it so that character_checking hasn't type void, but type string and that no skill usage Code is inside. Then the only Thing this function does is return the character string and nothing more. Now in your other function, you can ask something like "if (character_checking() == "Michael")" and put your skill Code in the if branch.Hope that helps. URL: http://forum.audiogames.net/viewtopic.php?pid=350721#p350721 ___ Audiogames-reflector mailing list Audiogames-reflector@sabahattin-gucukoglu.com https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector
BGT dilemma
2018-02-03
Thread
AudioGames . net Forum — Developers room : stefan_ilioaica via Audiogames-reflector
BGT dilemma Hi, everyone.While I was playing with BGT a little, and wanted to implement something, I've realised that I have no idea how to do it.To be honest, I have more ideas of ways to implement what I want, but I'm not sure at all what to do... I'll explain bellow what I'm doing.So, I've created a menu with several characters where you can choose from.If you choose a character, the string character will get a particular name, and depending on what character you have chosen, it will perform different actions, if you press A, S, or D keys on the keyboard.Because each character has different skills and techniques, I made a function which is checking what character you have, as a result, each character will perform his specific action.The problem is that I know how to make it work if I'm using just one key, and each character has just one skill.But, what to do if each character is having 3 assigned key, so in short, 3 uniques skills?I'll let you know what I made so far below.void lupta(){while(true){if(key_pressed(KEY_A)){character_checking();}if(key_pressed(KEY_S)){character_checking();}void character_checking(){if(character=="Michael"){fighter.play_wait();fighter1.play();}As you can see, I put in the code only one technique, but my character has 3 skills by pressing A, S, D, and I have 3 or 4 different characters with their own skills.How to make the program to check it properly in the easiest way properly?Should I use classes, or what metod would you recommend?If it would have be using just one skill for each character, so, just one key, it would be really easy.But now, with multiple characters and each one having 3 different skills, I really don't know how to make the script to check the character when I'm pressing the above mentioned keys.Sorry that the post is the long, but I wanted to explain it as detailed as I call, although I'm sure it will need more explaination later.Hope to get some info about this issue.Thanks in advance. URL: http://forum.audiogames.net/viewtopic.php?pid=350714#p350714 ___ Audiogames-reflector mailing list Audiogames-reflector@sabahattin-gucukoglu.com https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector