Re: Bgt question
Re: Bgt question Yeah, it should be recursive. Your function might just work, I'll just need to figure out a way I can make it work properly how I want to. Thanks anyways. URL: https://forum.audiogames.net/post/446832/#p446832 -- Audiogames-reflector mailing list Audiogames-reflector@sabahattin-gucukoglu.com https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector
Re: Bgt question
Re: Bgt question Do you want it to be recursive, and can you proof it against people copying a directory into itself and causing it to replicate until you run out of disc space?You can probably get away with directory_create, then use a for loop to copy the files. Unless file_copy takes wildcards, in which case file_copy(dir + "\\*", newdir + "\\*")... but I think you need the loop.To make it recursive, you'd need a function that calls itself for every subdirectory. Again, with something like that, it must be able to avoid copying to itself, otherwise it will not stop until you run out of space, and maybe not even then, if it just ignores errors and keeps trying. Ex:void deepcopy (string head, string dest) { string[] dirs = find_directories(head + "\\*"); for (uint j = 0; j < dirs.length(); j++) deepcopy(head + "\\" + dirs[j], dest + "\\" + dirs[j]); string[] files = find_files(head + "\\*"); for (uint j = 0; j}Disclaimer: not tested, not infinite-proof. URL: https://forum.audiogames.net/post/446822/#p446822 -- Audiogames-reflector mailing list Audiogames-reflector@sabahattin-gucukoglu.com https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector
Re: Bgt question
Re: Bgt question BGT has functions for find files and find directories, but it doesn't have a way to directly copy a directory. You can copy files though.This is actually super easy to accomplish in Python with a couple lines of code, but I'm not sure the less complex way of handling this in BGT. URL: https://forum.audiogames.net/post/446808/#p446808 -- Audiogames-reflector mailing list Audiogames-reflector@sabahattin-gucukoglu.com https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector
Bgt question
Bgt question Hi all,I was wondering if anyone knew of a way of copying a directory to another one in bgt, including all of it's subfolders / files?The only ways I've thought to do this so far haven't really worked well at all. The closest thing I've been able to do so far was write a function that takes an array containing all the folders to copy then another containing all of the files, but of corse that just puts all the files and folders in the location you spessify regardless of where they should be, which is quite messy.Thanks in advance. URL: https://forum.audiogames.net/post/446807/#p446807 -- Audiogames-reflector mailing list Audiogames-reflector@sabahattin-gucukoglu.com https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector
Re: BGT question
Re: BGT question woops, cant post html in the forom. URL: https://forum.audiogames.net/post/416347/#p416347 -- Audiogames-reflector mailing list Audiogames-reflector@sabahattin-gucukoglu.com https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector
Re: BGT question
Re: BGT question sorry to be the reaper here, but I hav some questions to ask.1 can someone give me a item class and a invantorry class?2can someone tell me how to make long wange weapons?3how do you implement 3d sound with bgt?4can someone help with makeing a steircace class? URL: https://forum.audiogames.net/post/416346/#p416346 -- Audiogames-reflector mailing list Audiogames-reflector@sabahattin-gucukoglu.com https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector
Re: BGT question
Re: BGT question sorry to be the reaper here, but I hav some questions to ask.1 can someone give me a item class and a invantorry class?2can someone tell me how to make long wange weapons?3how do you implement 3d sound with bgt?4can someone help with makeing a steircace class? URL: https://forum.audiogames.net/post/416346/#p416346 -- Audiogames-reflector mailing list Audiogames-reflector@sabahattin-gucukoglu.com https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector
Re: BGT question
Re: BGT question @3 I want to create a weapon without any special conditions URL: https://forum.audiogames.net/post/414384/#p414384 -- Audiogames-reflector mailing list Audiogames-reflector@sabahattin-gucukoglu.com https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector
Re: BGT question
Re: BGT question its from zombie arena URL: https://forum.audiogames.net/post/414375/#p414375 -- Audiogames-reflector mailing list Audiogames-reflector@sabahattin-gucukoglu.com https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector
Re: BGT question
Re: BGT question Plus, i'm 99.9 per cent sure that code is from dizafio mortle or ultrapower. I know i've seen that somewhere before. URL: https://forum.audiogames.net/post/414347/#p414347 -- Audiogames-reflector mailing list Audiogames-reflector@sabahattin-gucukoglu.com https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector
Re: BGT question
Re: BGT question @2, this is pretty much a terrible way to make weapons. With those kinds of variables, you might as well put them in a class for more flexability, cleaner code, and more maintainable systems. URL: https://forum.audiogames.net/post/414338/#p414338 -- Audiogames-reflector mailing list Audiogames-reflector@sabahattin-gucukoglu.com https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector
Re: BGT question
Re: BGT question That question is way to broad. There are any number of ways to code in a weapon and a lot of it depends on how you plan to use it in any given game.Some people might choose to create an entire weapon object. Some programs may not need that approach.Are there other types of weapons? Do your weapons change during the course of the game? How do they change: upgrade, leveling, spontaneous transmutation?You need to be much more specific in your question and how your program will work. And remember not many people here are willing to write your code for you. If you have a question about particular syntax, we would be happy to point you in the right direction--maybe even outline some pseudo code for you. But I, for one, would like you to narrow your question quite a bit before I could truly help you. URL: https://forum.audiogames.net/post/414309/#p414309 -- Audiogames-reflector mailing list Audiogames-reflector@sabahattin-gucukoglu.com https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector
Re: BGT question
Re: BGT question hieg like thisint weapon0damage=10;int weapon0range=4;int weapon0time=120;int weapon0speed=30;bool weapon0scatter=false;timer weapontimer;if (key_pressed(KEY_GRAVE)){speak("sword");weapon=0;p.play_stationary("sworddraw.ogg",false);weapondamage=weapon0damage;weaponrange=weapon0range;weapontime=weapon0time;weaponspeed=weapon0speed;weaponscatter=weapon0scatter;}); URL: https://forum.audiogames.net/post/414305/#p414305 -- Audiogames-reflector mailing list Audiogames-reflector@sabahattin-gucukoglu.com https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector
BGT question
BGT question hello how I can create a weapon using BGT. for example a sword thanks URL: https://forum.audiogames.net/post/414304/#p414304 -- Audiogames-reflector mailing list Audiogames-reflector@sabahattin-gucukoglu.com https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector
Re: BGT question
Re: BGT question @CAE_Jones:ding.wav and chord.wav are working fine. But other *.wav files aren't working. Is it better to use *.ogg files instead? URL: http://forum.audiogames.net/viewtopic.php?pid=335074#p335074 ___ Audiogames-reflector mailing list Audiogames-reflector@sabahattin-gucukoglu.com https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector
Re: BGT question
Re: BGT question BGT does have issues with wav files of certain bitdepths. Specifically, I think it only plays wavs with bitdepths that are powers of 2 (8, 16, 32), but not 24 or 36, etc. Maybe try playing c:\\windows\\media\\ding.wav, since that one always works. That file got kinda quiet post-xp, so if you want something louder, chord.wav is also reliable.If you can't get it to play ding or chord, then there is a very strange problem to be solved. URL: http://forum.audiogames.net/viewtopic.php?pid=335026#p335026 ___ Audiogames-reflector mailing list Audiogames-reflector@sabahattin-gucukoglu.com https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector
Re: BGT question
Re: BGT question @CAE_Jones:When I try playing wav files in bgt, bgt plays no sound at all. When I include a *.ogg file, it plays the sound. URL: http://forum.audiogames.net/viewtopic.php?pid=335024#p335024 ___ Audiogames-reflector mailing list Audiogames-reflector@sabahattin-gucukoglu.com https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector
Re: BGT question
Re: BGT question You don't need to include the dll, just use the screen_readerlesset_library_path funtion (I forget what it's called, but it's in the manual near the screen_reader_speak function).BGT plays .wav and .ogg. You would need external libraries to play other filetypes. URL: http://forum.audiogames.net/viewtopic.php?pid=335015#p335015 ___ Audiogames-reflector mailing list Audiogames-reflector@sabahattin-gucukoglu.com https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector
Re: BGT question
Re: BGT question @CAE_Jones:I tried playing *.ogg files with bgt and it worked. Can bgt only play *.ogg files?I tried including nvda and it gave me an compilation error:File: C:\Program Files (x86)\BGT\include\nvdaControllerClient32.dllOn line: 1 (3)Line: MZÿÿ¸@غ´ Í!¸LÍ!This program cannot be run in DOS mode.Error: Expected identifierFile: C:\Program Files (x86)\BGT\include\nvdaControllerClient32.dllOn line: 1 (3)Line: MZÿÿ¸@غ´ Í!¸LÍ!This program cannot be run in DOS mode.Error: Instead found ''What am I doing wrong? URL: http://forum.audiogames.net/viewtopic.php?pid=335011#p335011 ___ Audiogames-reflector mailing list Audiogames-reflector@sabahattin-gucukoglu.com https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector
Re: BGT question
Re: BGT question @CAE_Jones:Thank you for the code.*.ogg files aren't working for me. Only *.wav files work.How is it possible to implement nvda in bgt?When I type:#include "license.txt"#include "nvdaControllerClient32.dll"bgt sends an error. How can I fix this? URL: http://forum.audiogames.net/viewtopic.php?pid=334994#p334994 ___ Audiogames-reflector mailing list Audiogames-reflector@sabahattin-gucukoglu.com https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector
Re: BGT question
Re: BGT question Yes, BGT can play .ogg files. If you want to do a non-repeating random sequence, that's a bit more complicated.You could accomplish this in several different ways. For example, you could have a third array, this one of bools, and do something like this:bool[] shown(size);// Don't assume it will initialize to all false:for (uint i=0; i<size; i++) { shown[i]=false; } string text="−";while (text != "") // allow the user a way to quit early.{ int index=random(0, size-1); while (shown[index]) { // check to see if we're done: bool done=true; for (uint i=0; i<size; i++) { if(!shown[i]) done=false; } if (done) index=-1; else index=random(0, size-1); if (done) break; } if (index<0) break; text = input_box(question[index], "Your answer:"); if (text=="" or text=="quit") break; // Ignore case: text=string_too_lower_case(text); if (answers[index]==text) { shown[index] = true; alert("Correct!", "That is the correct response!"); } else { alert("Incorrect!", "That is not correct!"); } } alert ("That\'s all!", "Thanks for playing!"); URL: http://forum.audiogames.net/viewtopic.php?pid=334939#p334939 ___ Audiogames-reflector mailing list Audiogames-reflector@sabahattin-gucukoglu.com https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector
Re: BGT question
Re: BGT question Something like this (replace the questions and answers as you wish):void main() { int size=3; // Or however many questions you want. string[] questions(size); string[] answers(size); questions[0] = "Say hello."; answers[0] = "hello"; questions[1] = "What color is the sky?"; answers[1] = "blue"; questions[2] = "How many licks does it take to get to the Tootsy Roll center of a Tootsy Pop?"; answers[2] = "3 if you're an owl"; // now, pick one: int index = random(0, size-1); string text = input_box(questions[index], "Your answer:"); // Just to be safe, let's make sure the answer and input are the same case: text = string_to_lower_case(text); if(text == answers[index]) { alert("Correct!", "You gave the correct response!"); } else { alert("Incorrect!", "That is not the right answer!"); }} URL: http://forum.audiogames.net/viewtopic.php?pid=334852#p334852 ___ Audiogames-reflector mailing list Audiogames-reflector@sabahattin-gucukoglu.com https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector
Re: BGT question
Re: BGT question You don't need to include license.txt, just the nvda controller client dll.I'm not sure what's up with the ogg issue. Can you paste an example that doesn't work? URL: http://forum.audiogames.net/viewtopic.php?pid=335007#p335007 ___ Audiogames-reflector mailing list Audiogames-reflector@sabahattin-gucukoglu.com https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector
Re: BGT question
Re: BGT question @CAE_Jones:Thank you for the code.*.ogg files aren't working for me. Only *.wav files work.How is it possible to implement nvda in bgt?When I type:#include "license.txt"#include "nvdaControllerClient32.dll"bgt sends an error. How can I fix this? URL: http://forum.audiogames.net/viewtopic.php?pid=334994#p334994 ___ Audiogames-reflector mailing list Audiogames-reflector@sabahattin-gucukoglu.com https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector
Re: BGT question
Re: BGT question Yes, BGT can play .ogg files. If you want to do a non-repeating random sequence, that's a bit more complicated.You could accomplish this in several different ways. For example, you could have a third array, this one of bools, and do something like this:bool[] shown(size);// Don't assume it will initialize to all false:for (uint i=0; i<size; i++) { shown[i]=false; } string text="−";while (text != "") // allow the user a way to quit early.{ int index=random(0, size-1); while (shown[index]) { // check to see if we're done: bool done=true; for (uint i=0; i<size; i++) { if(!shown[i]) done=false; } if (done) index=-1; else index=random(0, size-1); if (done) break; } if (index<0) break; text = input_box(question[index], "Your answer:"); if (text=="" or text=="quit") break; // Ignore case: text=string_too_lower_case(text); if (answers[index]==text) { shown[index] = true; alert("Correct!", "That is the correct response!"); } else { alert("Incorrect!", "That is not correct!"); } } alert ("That\'s all!", "Thanks for playing!"); URL: http://forum.audiogames.net/viewtopic.php?pid=334939#p334939 ___ Audiogames-reflector mailing list Audiogames-reflector@sabahattin-gucukoglu.com https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector
Re: BGT question
Re: BGT question @CAE_Jones:Thank you. Can bgt only play *.wav files or can it also play *.ogg files?I wanted bgt to randomize all three questions, so when I answer one question, he program proceeds with the second question and so on, until all three questions are answered correctly. URL: http://forum.audiogames.net/viewtopic.php?pid=334906#p334906 ___ Audiogames-reflector mailing list Audiogames-reflector@sabahattin-gucukoglu.com https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector
Re: BGT question
Re: BGT question Yes. Hint: for the sound object, it's a property, and for the sound_pool, there are, like, three ways. URL: http://forum.audiogames.net/viewtopic.php?pid=334890#p334890 ___ Audiogames-reflector mailing list Audiogames-reflector@sabahattin-gucukoglu.com https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector
Re: BGT question
Re: BGT question I'm going to be a bit rude and say go read the manual -- specifically the reference manual. It's in there somewhere. Yeah, it's rude, but this answer is probably exactly the answer you'd get on other dev forums especially since the answer is already in the manual. URL: http://forum.audiogames.net/viewtopic.php?pid=334886#p334886 ___ Audiogames-reflector mailing list Audiogames-reflector@sabahattin-gucukoglu.com https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector
BGT question
BGT question HelloIs there a way to check if a sound is playing in BGT? URL: http://forum.audiogames.net/viewtopic.php?pid=334884#p334884 ___ Audiogames-reflector mailing list Audiogames-reflector@sabahattin-gucukoglu.com https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector
BGT question
BGT question HelloIs there a way to check if a sound is playing BGT? URL: http://forum.audiogames.net/viewtopic.php?pid=334884#p334884 ___ Audiogames-reflector mailing list Audiogames-reflector@sabahattin-gucukoglu.com https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector
Re: BGT question
Re: BGT question You want random (0, size-1), and size must be greater than 0.I typed the example on my phone, so haven't tested it yet. reading it again, nothing jumps out at me as likely to break it. Have you tried it exactly as written? If it compiles, how many times did you run it without any change?There might be some number typo somewhere, but I still haven't found it.[edit] Yeah, I tested it, and it works perfectly on my computer. It took running it 5 times to get all 3 questions. Remember that for the random function, the first value must be smaller than the second value. Also, arrays are 0-based.[/edit] URL: http://forum.audiogames.net/viewtopic.php?pid=334862#p334862 ___ Audiogames-reflector mailing list Audiogames-reflector@sabahattin-gucukoglu.com https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector
Re: BGT question
Re: BGT question You want random (0, size-1), and size must be greater than 0.I typed the example on my phone, so haven't tested it yet. reading it again, nothing jumps out at me as likely to break it. Have you tried it exactly as written? If it compiles, how many times did you run it without any change?There might be some number typo somewhere, but I still haven't found it. URL: http://forum.audiogames.net/viewtopic.php?pid=334862#p334862 ___ Audiogames-reflector mailing list Audiogames-reflector@sabahattin-gucukoglu.com https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector
Re: BGT question
Re: BGT question You want random (0, size-1), and size must be greater than 0.I typed the example on my phone, so haven't tested it yet. It is literally a rewrite of the first program I ever wrote, though, and reading it again, nothing jumps out at me as likely to break it. Have you tried it exactly as written? If it compiles, how many times did you run it without any change?There might be some number typo somewhere, but I still haven't found it. URL: http://forum.audiogames.net/viewtopic.php?pid=334862#p334862 ___ Audiogames-reflector mailing list Audiogames-reflector@sabahattin-gucukoglu.com https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector
Re: BGT question
Re: BGT question @CAE_Jones:Have you tried out the program? The program randomizes nothing at all. When I put this line into my code:int index = random(1, size-1);the program only presents the first question.I wanted the program to randomize questions[0] questions[1] and questions[2]. URL: http://forum.audiogames.net/viewtopic.php?pid=334858#p334858 ___ Audiogames-reflector mailing list Audiogames-reflector@sabahattin-gucukoglu.com https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector
Re: BGT question
Re: BGT question Something like this (replace the questions and answers as you wish):void main() { int size=3; // Or however many questions you want. string[] questions(size); string[] answers(size); questions[0] = "Say hello."; answers[0] = "hello"; questions[1] = "What color is the sky?"; answers[1] = "blue"; questions[2] = "How many licks does it take to get to the Tootsy Roll center of a Tootsy Pop?"; answers[2] = "3 if you're an owl"; // now, pick one: int index = random(0, size-1); string text = input_box(questions[index], "Your answer:"); // Just to be safe, let's make sure the answer and input are the same case: text = stri ng_to_lower_case(text); if(text == answers[index]) { alert("Correct!", "You gave the correct response!"); } else { alert("Incorrect!", "That is not the right answer!"); }} URL: http://forum.audiogames.net/viewtopic.php?pid=334852#p334852 ___ Audiogames-reflector mailing list Audiogames-reflector@sabahattin-gucukoglu.com https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector
Re: BGT question
Re: BGT question @CAE_JonesThank you. Can you explain what I have to do step by step?What is a good programming language to write vocabularies with the random function? URL: http://forum.audiogames.net/viewtopic.php?pid=334849#p334849 ___ Audiogames-reflector mailing list Audiogames-reflector@sabahattin-gucukoglu.com https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector
Re: BGT question
Re: BGT question If I understand correctly, you probably want two arrays: one with the questions, and the other with the answers.You'd have answers[0] be the answer to questions[0], answers[1] for questions[1], etc.Then you'd create a random int to decide which question to show. Ex, int index = random(0, questions.length()-1);Then your input_box would take questions[index] where you'd normally put the answer.if(answers[index]==input) alert("Correct!", "You\'re right!");Hth URL: http://forum.audiogames.net/viewtopic.php?pid=334788#p334788 ___ Audiogames-reflector mailing list Audiogames-reflector@sabahattin-gucukoglu.com https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector
BGT question
BGT question Hi guys!I hope you can help me with my problem.How can i randomize two questions in bgt?Here is my code:void main(){string input;input=input_box("input_box", "what is bgt?", "");if(input=="a programming language"){alert("yes!", "The answer was indeed a programming language!");}else{alert("Sorry!", "The answer is a programming language, not "+input+"!");}string input1;input1=input_box("input_box", "what does tts mean?", "");if(input1=="text to speech"){alert("yes!", "The answer was indeed text to speech!");}else{alert("Sorry!", "The answer is text to speech, not "+input1+"!");}}Thanks for your help.Best regards. URL: http://forum.audiogames.net/viewtopic.php?pid=334766#p334766 ___ Audiogames-reflector mailing list Audiogames-reflector@sabahattin-gucukoglu.com https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector
Re: BGT question
Re: BGT question This is the wrong forum. URL: http://forum.audiogames.net/viewtopic.php?pid=334761#p334761 ___ Audiogames-reflector mailing list Audiogames-reflector@sabahattin-gucukoglu.com https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector
BGT question
BGT question Hi guys!I hope you can help me with my problem.How can i randomize two questions in bgt?Here is my code:void main(){string input;input=input_box("input_box", "what is bgt?", "");if(input=="a programming language"){alert("yes!", "The answer was indeed a programming language!");}else{alert("Sorry!", "The answer is a programming language, not "+input+"!");}string input1;input1=input_box("input_box", "what does tts mean?", "");if(input1=="text to speech"){alert("yes!", "The answer was indeed text to speech!");}else{alert("Sorry!", "The answer is text to speech, not "+input1+"!");}}Thanks for your help.Best regards. URL: http://forum.audiogames.net/viewtopic.php?pid=334756#p334756 ___ Audiogames-reflector mailing list Audiogames-reflector@sabahattin-gucukoglu.com https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector
Re: bgt question
Re: bgt question Yeah... I always keep forgetting to check the bgt tutorial. Thanks to that I also learned about interfaces, that is what my new game is using URL: http://forum.audiogames.net/viewtopic.php?pid=202800#p202800 ___ Audiogames-reflector mailing list Audiogames-reflector@sabahattin-gucukoglu.com https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector
Re: bgt question
Re: bgt question yep cae, I would love to be able to put variables in interfaes. Basically I am forced to make accessor and mutator methods instead. URL: http://forum.audiogames.net/viewtopic.php?pid=202643#p202643 ___ Audiogames-reflector mailing list Audiogames-reflector@sabahattin-gucukoglu.com https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector
Re: bgt question
Re: bgt question Where is the inheritance in your Purebasic example? And why is Purebasic coming up, anyway?The whole point of polymorphism is not variables, it is class methods. You cannot do polymorphism without very interesting pointer tricks in languages that do not provide built-in support for classes. You can do giant ugly switch statements and if trees based on a type field, but the whole point here is that inheritance and polymorphism get rid of said switch statements and if trees, splitting your code into something thats manageable and can be considered in isolated chunks. They also let you add new fields to your subclasses, i.e. Enemy versus NamedEnemy. And now were both off topic, I guess. URL: http://forum.audiogames.net/viewtopic.php?pid=202600#p202600 ___ Audiogames-reflector mailing list Audiogames-reflector@sabahattin-gucukoglu.com https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector
Re: bgt question
Re: bgt question Where is the inheritance in your Purebasic example? And why is Purebasic coming up, anyway?The whole point of polymorphism is not variables, it is class methods. You cannot do polymorphism without very interesting pointer tricks in languages that do not provide built-in support for classes. URL: http://forum.audiogames.net/viewtopic.php?pid=202600#p202600 ___ Audiogames-reflector mailing list Audiogames-reflector@sabahattin-gucukoglu.com https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector
Re: bgt question
Re: bgt question Hi,PureBASIC allows you to do this too. You can do something similar, but not like int num_enemies[] enemies;. Instead, you define a structure like so:Structure enemyname.sx.ly.lz.ltype.sEndStructureThen, wherever you like, polymorph it like so:Dim enemies.enemy(0)This is how DMPA and several of Reality Softwares games work. URL: http://forum.audiogames.net/viewtopic.php?pid=202595#p202595 ___ Audiogames-reflector mailing list Audiogames-reflector@sabahattin-gucukoglu.com https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector
Re: bgt question
Re: bgt question Also, congratulations on discovering polymorphism without being told about it. From where Im standing, thats exactly what you just did. And most programmers dont get it for a very long while even when its explained (I fell into this category, many a year ago). URL: http://forum.audiogames.net/viewtopic.php?pid=202434#p202434 ___ Audiogames-reflector mailing list Audiogames-reflector@sabahattin-gucukoglu.com https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector
Re: bgt question
Re: bgt question Oh, I am relieved. I didnt think you could do that for some reason. Thats very nice URL: http://forum.audiogames.net/viewtopic.php?pid=202432#p202432 ___ Audiogames-reflector mailing list Audiogames-reflector@sabahattin-gucukoglu.com https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector
Re: bgt question
Re: bgt question Yeah, actually polymorphism is explained in the bgt language tutorial. It is a beautiful thing once you figure it out. I wish bgt subported abstract classes though. They seem pretty cool, because they force you to conform to a syntax. Basically so you dont miss something when you define your subclasses. Thats what I learned about in java. URL: http://forum.audiogames.net/viewtopic.php?pid=202505#p202505 ___ Audiogames-reflector mailing list Audiogames-reflector@sabahattin-gucukoglu.com https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector
Re: bgt question
Re: bgt question Yes. Thats exactly how it works. URL: http://forum.audiogames.net/viewtopic.php?pid=202420#p202420 ___ Audiogames-reflector mailing list Audiogames-reflector@sabahattin-gucukoglu.com https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector
bgt question
bgt question I have an interesting bgt question:If I have for example a class called enemyAnd I make a subclass like this: Class spaceship : enemy and another called class tank : enemy;Can I then make an array of enemies enemy[] enemies; and put both tanks and spaceships?Thanks! URL: http://forum.audiogames.net/viewtopic.php?pid=202419#p202419 ___ Audiogames-reflector mailing list Audiogames-reflector@sabahattin-gucukoglu.com https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector
Re: bgt question
2015-01-26
Thread
AudioGames . net Forum — Developers room : audiogames . net fan via Audiogames-reflector
Re: bgt question Hi,I knew about this feature of bgt, but in the sort of minigames I am creating right now in it, I dont really need it for much as of right now. I can see it coming in very useful later on, though. URL: http://forum.audiogames.net/viewtopic.php?pid=202519#p202519 ___ Audiogames-reflector mailing list Audiogames-reflector@sabahattin-gucukoglu.com https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector
Re: bgt question
Re: bgt question Im not sure if youd necessarily need anything abstract classes provide that you cant get with interfaces, unless its variables? URL: http://forum.audiogames.net/viewtopic.php?pid=202522#p202522 ___ Audiogames-reflector mailing list Audiogames-reflector@sabahattin-gucukoglu.com https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector
Hi, I have a very stupid math / bgt question
Hi, I have a very stupid math / bgt question Hi everyone,I have a very stupid math question, possibly only related to bgt.I am looking at various game examples and I see something like:score += board[player_position].landed ? 5 : 10;What do ? and : mean?Im sure its something really simple... what does this line do exactly?Thanks all URL: http://forum.audiogames.net/viewtopic.php?pid=201701#p201701 ___ Audiogames-reflector mailing list Audiogames-reflector@sabahattin-gucukoglu.com https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector
Re: Hi, I have a very stupid math / bgt question
Re: Hi, I have a very stupid math / bgt question thats actually not a stupid question, believe it or not. Many programmers dont know what that does.Its commonly called the ternary operator, or at least it is in common usage. There is probably a more official name for it, but as its the only operator that takes 3 operands ternary operator is pretty unambiguous.Anyhow, its a shorthand if statement:expr ? true : false;Evaluates to whatever true is if expr is true or whatever false is if expr is false. If you wrote it out the long way:if(expr) { variable =true; } else { variable = false }I dont use it often, but thats probably because most of my expressions are already pretty long (o the joys of mathematical coding) and its worth just breaking them up. Also it lets me put in comments.Perhaps the most common use is this line, which is usually abstracted behind a function:var = var 0 ? -var : var;Also known as absolute value. URL: http://forum.audiogames.net/viewtopic.php?pid=201714#p201714 ___ Audiogames-reflector mailing list Audiogames-reflector@sabahattin-gucukoglu.com https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector
Re: Hi, I have a very stupid math / bgt question
Re: Hi, I have a very stupid math / bgt question The operator is also called the conditional operator. I actually learned about this language in the concept of java and I instantly became in love with it. URL: http://forum.audiogames.net/viewtopic.php?pid=201736#p201736 ___ Audiogames-reflector mailing list Audiogames-reflector@sabahattin-gucukoglu.com https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector
Re: Hi, I have a very stupid math / bgt question
Re: Hi, I have a very stupid math / bgt question thanks guys for clearing that up URL: http://forum.audiogames.net/viewtopic.php?pid=201774#p201774 ___ Audiogames-reflector mailing list Audiogames-reflector@sabahattin-gucukoglu.com https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector
Re: Hi, I have a very stupid math / bgt question
Re: Hi, I have a very stupid math / bgt question Yep. Its not immediately obvious, but it is wonderful.Pythons version makes more sense, although its not in quite the same order, so porting between Python and C-like languages is more work with these.The Python version goes:x = A if p else cIIRC, theres no punctuation before the else. Itd be more screen reader readable if there was, but it at last makes a little more sense. I like ?: more for compactness, but Pythons goal is readability, and this is certainly more readable.(The developers of Python resisted adding it for ages, as Ive heard. But its too bloody convenient so people kept demanding it.) URL: http://forum.audiogames.net/viewtopic.php?pid=201755#p201755 ___ Audiogames-reflector mailing list Audiogames-reflector@sabahattin-gucukoglu.com https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector