1

I am trying to make a main menu using an array in Game Maker, and am using the following code to initialize it in the "Create" event. For the life of me I cannot figure out why it isn't working. I am getting the error:

Error at line 1 pos 5: Assignment operator expected.

So apparently the string variables are not assigning to the array indexes? Here is my code:

I am running Game Maker studio Professional Edition (v1.4.1567) if that helps.

menu[0] = "Start";
menu[1] = "Continue";
menu[2] = "Level Select";
menu[3] = "Options";
menu[4] = "Quit";
  • It's correct code. There is no an error. – Dmi7ry Mar 03 '18 at 04:18
  • You need to give more code, in some cases when there's error at line 1 pos 5 it may mean the error is after this line. You sure it's proper object/event, as this partial error message doesn't inform about this ? – gnysek Mar 08 '18 at 13:03

1 Answers1

0

your code is completely correct. that means that the error must be in another event. if you don't already know, the error you are getting means that there is either:

no equals sign after a variable assignment

this_var;
// should be:
this_var = something;

or no brackets after a function

instance_destroy
//should be:
instance_destroy()

go through your code one more time and check for these errors.