Re: arays in bgt, please let me understand them

2020-03-02 Thread AudioGames . net Forum — Developers room : rory-games via Audiogames-reflector


  


Re: arays in bgt, please let me understand them

yeah that is not a constructor. a constructor is just a default set of values for the variables in a class. Basically, the class is the ingredients, the constructor is how you mix them.

URL: https://forum.audiogames.net/post/505491/#p505491




-- 
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector


Re: arays in bgt, please let me understand them

2020-03-01 Thread AudioGames . net Forum — Developers room : amerikranian via Audiogames-reflector


  


Re: arays in bgt, please let me understand them

@7, no. The at sign does not mean that it's a constructor, at least not in the way you're probably intending to use the word.A constructor is only applicable to a class. It is a function that the class automatically calls whenever it is created. For example, a constructor would be something like this:class breakfast
{
//Create an empty array of ingredients and sides
string[] ingredients;
string[] sides;
//Here is a constructor
//I name the function parameters differently just to put myself at ease (I actually don't know if naming function parameters the same as variables could cause issues)
//Anyways. This function is automatically called whenever the object of type breakfast is instantiated (created).
breakfast(string[] ingrs, string[] sds)
{
engredients = ingrs;
sides = sds;
}
}So, to clarify:In BGT, a constructor must have it's class' name. I.e, a breakfast class cannot have a constructor named eggs_and_bacon. It can have a function with that name, which means that the user can manually call it by doing something like breakfast.eggs_and_bacon();, but the engine will not treat the function as a constructor (the first function that the class will call upon it's creation).A constructor is the first function which will be called: I can't stress this enough. It can accept parameters and change the classes attributes depending on what is being passed to it.Now, onto an at sign:From what I understand, the at sign creates an array of handles to objects. Thing is, I also had a difficult time understanding the topic. A good rule of thumb is to follow post 5's advice, though.

URL: https://forum.audiogames.net/post/505270/#p505270




-- 
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector


Re: arays in bgt, please let me understand them

2020-02-29 Thread AudioGames . net Forum — Developers room : amerikranian via Audiogames-reflector


  


Re: arays in bgt, please let me understand them

Doubles and floats technically are the same in that they store decimals, but one allows for more accuracy (double I think).

URL: https://forum.audiogames.net/post/505149/#p505149




-- 
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector


Re: arays in bgt, please let me understand them

2020-02-29 Thread AudioGames . net Forum — Developers room : Jaidon Of the Caribbean via Audiogames-reflector


  


Re: arays in bgt, please let me understand them

I thought doubles and floats were the same thing?

URL: https://forum.audiogames.net/post/505115/#p505115




-- 
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector


Re: arays in bgt, please let me understand them

2020-02-29 Thread AudioGames . net Forum — Developers room : Meatbag via Audiogames-reflector


  


Re: arays in bgt, please let me understand them

never mind my stupity, this line, enemy@[]enemies(0);is that what's called a kinstructter?

URL: https://forum.audiogames.net/post/505109/#p505109




-- 
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector


Re: arays in bgt, please let me understand them

2020-02-29 Thread AudioGames . net Forum — Developers room : Meatbag via Audiogames-reflector


  


Re: arays in bgt, please let me understand them

hmm, that can save me a lot of time, thank you a lot!

URL: https://forum.audiogames.net/post/505108/#p505108




-- 
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector


Re: arays in bgt, please let me understand them

2020-02-29 Thread AudioGames . net Forum — Developers room : rory-games via Audiogames-reflector


  


Re: arays in bgt, please let me understand them

basically, ending a type with [] makes it an aray. you can make them with strings, ints, floats, doubles, or even classes.The length() functions outputs how many things are in the aray (or list as we are refering to them).Remember that when using classes, you must put an @ symbol at the end of the type name, like this.enemy@[]enemies(0);that would declare an array of type enemy with nothing in it.

URL: https://forum.audiogames.net/post/505105/#p505105




-- 
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector


Re: arays in bgt, please let me understand them

2020-02-29 Thread AudioGames . net Forum — Developers room : Meatbag via Audiogames-reflector


  


Re: arays in bgt, please let me understand them

sorry for posting 2 times, but can I make in array of integers or flotes? or its just in strings?

URL: https://forum.audiogames.net/post/505099/#p505099




-- 
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector


Re: arays in bgt, please let me understand them

2020-02-29 Thread AudioGames . net Forum — Developers room : Meatbag via Audiogames-reflector


  


Re: arays in bgt, please let me understand them

ok, what will sho up in this alert?alert("test size", "We must do "+test.length()+" things in the morning");will it sho the hol list?

URL: https://forum.audiogames.net/post/505077/#p505077




-- 
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector


Re: arays in bgt, please let me understand them

2020-02-29 Thread AudioGames . net Forum — Developers room : ivan_soto via Audiogames-reflector


  


Re: arays in bgt, please let me understand them

I'll try to explain...I hope that I don't explain this in such a way that will confuse you even more, but arrays are very simple.Think of arrays as lists of items. If you have a list of things to do you write them down, voice-record them, whatever, but it's a list either way.This could be applied to arrays.string[] test;We just asigned a new variable(of type 'array') and called it test.Now in our main function we do the following:test.insert_last("eat breakfast");test.insert_last("Get ready");test.insert_last("go to work");//and on we go with our day.We now have thre elements in our array, and you can check by doing something like:alert("test size", "We must do "+test.length()+" things in the morning");Getting a certain element can be just as easy, as we only need to pass the index or the number, at which the item is stored in memory.Remember that arrays are 0 based, meaning that the first index when initially adding to an array is 0 and not one.So if you want to access the "go to work" element, it is the number 2 and not the number 3.So we do:string last_action=test[2];alert("Ok", "The last thing you must do is "+last_action);I hoped that helped you out. Let me know if you're getting confused at a certain point.

URL: https://forum.audiogames.net/post/505048/#p505048




-- 
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector