Posted 15 August 2013 - 02:56 PM
hello :)/>
I'm currently developping a little API called utils2d wich is grouping function to help me coding my home computer (which will be leading machines, computers, misc peripherals, …)
Here is the actual code of the API :
http://pastebin.com/K04gFR3X
Sorry if the style is not common but i'm from the C++ and i'm used to think in object oriented ! So i use a little bit too much the table to structure all my datas logically. that's mainly why i passed through a function to get my tables well structured :)/> but then it allows me to used it very easily, in two lines i can display a box of the choosen color and then use it for collision events with the mouse…
So then i made a program called "menuprincipal" which is sensed to be my main menu.
here is the code :
http://pastebin.com/4ddqQQtj
note : MCEvent stand for MouseClickEvent and not MineCraftEvent ;)/> and the last call to the program screen is made for clearing up my screen and reset the terminal output
So here is my problem : when i launch menuprincipal i get this error :
So if you have got any idea or suggestion i take it ;)/>
PS : i'm french so excuse my poor english ^^' and the french portions in the code :P/>
EDIT : ok after digging a little in the lua native oriented object syntax, i found that my code could have been rewritten in a much more better way for the function drawBox essentially, which could be a part of the box2d table, nevermind i will change this soon :)/> love the OO :P/>
I'm currently developping a little API called utils2d wich is grouping function to help me coding my home computer (which will be leading machines, computers, misc peripherals, …)
Here is the actual code of the API :
http://pastebin.com/K04gFR3X
Sorry if the style is not common but i'm from the C++ and i'm used to think in object oriented ! So i use a little bit too much the table to structure all my datas logically. that's mainly why i passed through a function to get my tables well structured :)/> but then it allows me to used it very easily, in two lines i can display a box of the choosen color and then use it for collision events with the mouse…
So then i made a program called "menuprincipal" which is sensed to be my main menu.
here is the code :
http://pastebin.com/4ddqQQtj
note : MCEvent stand for MouseClickEvent and not MineCraftEvent ;)/> and the last call to the program screen is made for clearing up my screen and reset the terminal output
So here is my problem : when i launch menuprincipal i get this error :
I don't understand where it could came from. I've spend a couple of hours on the code and now my eye are too much tired to find the little things that makes all bug… :/ i'm sure it's obvious but i can't find it !menuprincipal:4: attempt to index ? (a nil value)
So if you have got any idea or suggestion i take it ;)/>
PS : i'm french so excuse my poor english ^^' and the french portions in the code :P/>
EDIT : ok after digging a little in the lua native oriented object syntax, i found that my code could have been rewritten in a much more better way for the function drawBox essentially, which could be a part of the box2d table, nevermind i will change this soon :)/> love the OO :P/>