# I dont understand can some one help?

I opened up Geometry Monster I’m trying to make it as a template for my game. I don’t understand this part of the coding.

What I understand

Random shapes will spawn, there are 4 shapes in total. However, I’m kinda lost at the X position and Y position. The Geometry Monster has a height of 640 and that’s all HAHAHA. Can someone enlighten me? Like if I were to change the width and height of the template (example:1920x1080), how am I suppose to change the event to fit the new size?

The RandomInRange(x1,x2) function generates a random number between the first parameter and the second parameter. In your example it’s x1 = 80 and x2 = 640 - 80. So the Shape will be created somewhere between x position 80 and 640-80 randomly ( but 640-80 = 560 always, so it doesn’t make sense to put that there).
The y position is always -100 and that doesn’t change.

The object to create is always of a random name “Shape1” or “Shape2” or “Shape3” or “Shape4”, because the number that is added to the name is randomly generated from RandomInRange(1,4), so a number between 1 to 4.

Edit: err, forgot to add that if you want to generate the shape at a specific position just put the desired position at the X Position and Y Position fields. If you want to give it another size then use the Change Size event and put Width = 1920 and Height = 1080

1 Like

Oh got it! I was confused must it be 80 hehe, Thank you!!

Want to correct myself. It can make sense to put an arithmetic expression like 640 - 80, just for readability and logic reasons. In this case I guess someone wanted to point out that there must be a space of 80 between the border of the screen and the width of the object could be max 80.

1 Like