This was the best tutorial for arrays in gamemaker i have found. Thank you for uploading this.
@sirGuy1995 Жыл бұрын
Thank you! As someone without a ton of professional coding knowledge, this was an excellent introduction to the concepts!
@zarteen6 жыл бұрын
Thank you for this. This was exactly what I needed to really start improving c:
@a.vanmeel12083 жыл бұрын
Great Job. Thank you for this tutorial.
@danieladamczyk40246 жыл бұрын
Understunding of arrays is thing what i need to make my game. Keep going whit it. Good stuff.
@LetsLearnThisTogether6 жыл бұрын
+Daniel Adamczyk Part two is coming out soon.
@danieladamczyk40246 жыл бұрын
Beyond Us Games thank you
@winniZX816 жыл бұрын
Excellent video. Keep up the good work
@Quentin943 жыл бұрын
Thank you, this will help a lot.
@Cablesfish3 жыл бұрын
Awesome video. Thanks a lot!
@spiritgame62595 жыл бұрын
Excellent video!!!!
@SonictheHedgehogInRealLife4 жыл бұрын
Your intro is really cool
@astrobread73004 жыл бұрын
thank you man this helps
@Clod155 жыл бұрын
Thank you very much! =]
@NaikoArt5 жыл бұрын
awesome!
@ryarod3 жыл бұрын
Hello. Regarding the making of the "menu" array: Is creating an array as simple as just typing one word with a "[#] =" attached? Or is there something else we have to do in order to make that an array in the first place? I ask because I see you typing "menu[0] = "New Game""; "menu[1] = Load Game"; etc., and you achieve results for your tutorial; and yet, I try something similar in my project and I've yet to achieve critical mass, as if it doesn't read that the array is there. That being said, I'm doing something different from making a menu, so it could be I just have the wrong context; hence why I'm asking.
@LetsLearnThisTogether3 жыл бұрын
Yes, creating an array is as simple as that. GML makes it very easy. What are you trying to do?
@ryarod3 жыл бұрын
@@LetsLearnThisTogether I am making a point-and-click adventure game. I have given my cursor icon separate sprites for separate states, depending on what the cursor is hovering on. I want the cursor to change its shape if it lands on any of several particular objects of interest. I have successfully made it change shape like this for when it's on top of one particular object. I wanted to create an array that contains all objects of interest, and then just put that array's name where that one object is. This has yet to work.
@LetsLearnThisTogether3 жыл бұрын
Hmmm. I might do an array like you’re saying, and then just have each object have a number and that number corresponds to what slot in the array the mouse should look like.
@ryarod3 жыл бұрын
@@LetsLearnThisTogether I'm about to try it. I must say though that seems in text to be nearly the same: I still have to code an entire block per individual object, it's just I'd be using a number instead of the object name. If I could type a range, I could use just one block to react to all those objects. Hence my being here on Arrays.
@LetsLearnThisTogether3 жыл бұрын
Hmm, maybe we’re not communicating clearly. I think I understand what you’re trying to do, and the solution I suggested would have you create just one array and then one variable in each object. You don’t need a lot of code. The mouse object has an array of all the different sprites it can be. The other objects just contain a number, an index in that array, that the mouse changes to when it’s colliding with them.
@whoolieman6 жыл бұрын
nice tut !
@elbituan4 жыл бұрын
My friend, for some reason the machine translation subtitles are failing, can you please verify your video in video editing CC options and validate the overlap?
@Orangetictac4 жыл бұрын
Did you figure out how to not have it go a mile a minute at the 12:47 mark without slowing the room down? This is what I am stuck on, trying to get text to stay there for a while but picking randomly after that while is down. Thanks!
@marzipug54394 жыл бұрын
I assume you could put the code to randomly draw the text in an alarm with a timer on it. Just set the alarm to room_speed*(seconds) and then make sure to reset the alarm to make it loop (put alarm[0] = room_speed*(seconds) at the end of the alarm[0] event.)
@Troylglover4 жыл бұрын
how do I write this, outside of a 'text' ? I can't figure out how to write the random 'menu' menu[0] = "0"; //E menu[1] = "45"; //NE menu[2] = "90"; //N menu[3] = "135"; //NW menu[4] = "180"; //W menu[5] = "225"; //SW menu[6] = "270"; //S menu[7] = "315"; //SE menu[irandom(array_length_1d(menu)-1)]; if(menu = 0){ sprite_index = sguardwalke; } else if(menu = 1){ sprite_index = sguardwalkne; }
@LetsLearnThisTogether4 жыл бұрын
The problem I see is you're wrapping your integers (numbers) in quotes, which makes them a string. You can store anything in an array. Remove the quotes. Then when you compare, be sure to use == instead of just = (I know GM won't throw a fit most of the time, but it's better to learn good coding habits now). After that, it should work, because you'll no longer be comparing a string to a number, but a number to a number.
@Troylglover4 жыл бұрын
@@LetsLearnThisTogether Thank you for helping me. I made the changes. It only chooses either 0 or 180 but the sprite_ index wont change. I'm very new to GMS, I don't see what I'm wrong lol
@mchsprod3 жыл бұрын
I was a bit “eh” about arrays until you talked about the for loop not caring about the amount of items. At that moment I had flashbacks to programming with Scratch, having to make a new variable for every item, having to copy code and dealing with so many problems. I knew arrays were helpful, but you made me realise that a world without arrays would be a nightmare.
@LetsLearnThisTogether3 жыл бұрын
Glad to hear I was able to induce flashbacks to traumatic events :)
@naelpontes8444 Жыл бұрын
You can also make an empty array by just typing smth like array_name = [ ] , iirc
@lauren92904 жыл бұрын
that do be useful
@realpunkfruit4 жыл бұрын
i think i have arrays down, for loops are still giving me a headache tho ;P
@LetsLearnThisTogether4 жыл бұрын
Yep, sounds about right. They take a lot of practice, so just don’t give up.
@sev7nsev7n75 жыл бұрын
how can I use an array as a variable, and if any of the elements in there is true then do whatever?
@LetsLearnThisTogether5 жыл бұрын
Just like anything else in GMS. myArray[0] = true; myArray[1] = false; Your variable is myArray and then you've got index's you access with the brackets []. If you put a value in there, then you can access it, but if you don't and try to access it you'll get an error.
@Troylglover4 жыл бұрын
I have this in the create event menu[0] = 0; menu[1] = 45; menu[2] = 90; menu[3] = 135; menu[4] = 180; menu[5] = 225; menu[6] = 270; menu[7] = 315; image_speed = 1; -------------------------------------------------------------- I have this in the spacebar event menu[irandom(array_length_1d(menu)-1)]; if(menu == 0) {sprite_index = sguardwalke;} else if(menu == 1) {sprite_index = sguardwalkne;} else if(menu == 2) {sprite_index = sguardwalkn;} else if(menu == 3) {sprite_index = sguardwalknw;} else if(menu == 4) {sprite_index = sguardwalkw;} else if(menu == 5) {sprite_index = sguardwalksw;} else if(menu == 6) {sprite_index = sguardwalks;} else if(menu == 7) {sprite_index = sguardwalkse;} this is the error message I get Error : gml_Object_oguard_KeyPress_32(0) : malformed assignment statement
@LetsLearnThisTogether4 жыл бұрын
Upload your project somewhere and send me the link, I'll take a look at it. You can also email me at aaron@letslearnthistogether.com