Jump to content

Recommended Posts

Posted

So Im trying to make a simple 2d game and make some sort of collision detection so why not to make a 2 dimensional array but i have no clue how  to write it in multiple lines

Global $map[5,5] = [0,0,0,0,0 _
                   [0,0,0,0,0 _
                   [0,0,0,0,0 _
                   [0,0,0,0,0 _
                   [0,0,0,0,0]

something like this but it doesn't work

Posted (edited)

Try in this way:

Global $map[5][5] = [[0,0,0,0,0], _
                     [0,0,0,0,0], _
                     [0,0,0,0,0], _
                     [0,0,0,0,0], _
                     [0,0,0,0,0]]

:)

Edited by FrancescoDiMuro

Click here to see my signature:

  Reveal hidden contents

 

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...