function attributes in the wrong order?

Questions about the LÖVE API, installing LÖVE and other support related questions go here.
Forum rules
Before you make a thread asking for help, read this.
Post Reply
martov
Prole
Posts: 12
Joined: Thu May 22, 2014 10:55 pm

function attributes in the wrong order?

Post by martov »

Im getting some trouble debugging this, for some weird reason when I call my function the attibutes come into the function in the wrong order

im calling the function clases.manzana:create(love.mouse.getX,love.mouse.getY, sometable)
and if I print those values inside the function, the first attribute is the table, the second is the x position and the third is the Y position.

[screenshot here]
http://postimg.org/image/59qlmf387/full/

Im really confused, I tried changing the names of the variables to see if it was some scope issue or something, but it didnt work :/
User avatar
Kingdaro
Party member
Posts: 395
Joined: Sun Jul 18, 2010 3:08 am

Re: function attributes in the wrong order?

Post by Kingdaro »

You've defined the function "create" with a period ( . ), but are calling it with a colon ( : ). Use one or the other, and be consistent.

If you wish to know what these markings mean individually, here's some more info.
davisdude
Party member
Posts: 1154
Joined: Sun Apr 28, 2013 3:29 am
Location: North Carolina

Re: function attributes in the wrong order?

Post by davisdude »

We need to see classes.mananza:create to really help you. Or a .love, preferably.
GitHub | MLib - Math and shape intersections library | Walt - Animation library | Brady - Camera library with parallax scrolling | Vim-love-docs - Help files and syntax coloring for Vim
martov
Prole
Posts: 12
Joined: Thu May 22, 2014 10:55 pm

Re: function attributes in the wrong order?

Post by martov »

thanks Kingdaro!

now I understand what was happening. :neko:
Post Reply

Who is online

Users browsing this forum: Bing [Bot] and 9 guests