Discord
Login
Community
DARK THEME

map.map.get(cx,cy) from Quick Engine

I was trying to use Quick Engine and check collision with Quick.mapCellAt(map,x,y)
But it give me this error: Warning: map.map.get(cx,cy) is not a function, in file "lib/quickengine" at line 378, column 27

Did you add a map to the engine using the Quick.addMap() function?

Yes

Make your app project public and link to your app project.

https://microstudio.dev/i/lollocenne/testquickengine/

the parameter you need to pass to the Quick.mapCellAt() function is object . You are passing a string variable.

bad code

  if Quick.mapCellAt("map", car.x + 10, car.y) != "wall" then
    //some code
  end

correct code

  if Quick.mapCellAt(map, car.x + 10, car.y) != "wall" then
    //some code
  end

checking what you are sending to the function

Quick.mapCellAt = function(map,x,y)
  print( map.type )
....

Thanks!

Post a reply

Progress

Status

Preview
Cancel
Post
Validate your e-mail address to participate in the community