Questions about platformer game
Forum rules
Before you make a thread asking for help, read this.
Before you make a thread asking for help, read this.
Re: Questions about platformer game
What is it?
lf = love.filesystem
ls = love.sound
la = love.audio
lp = love.physics
lt = love.thread
li = love.image
lg = love.graphics
ls = love.sound
la = love.audio
lp = love.physics
lt = love.thread
li = love.image
lg = love.graphics
-
- Prole
- Posts: 19
- Joined: Fri Aug 31, 2012 8:32 am
Re: Questions about platformer game
player.box=collider:addRectangle(blahblhablha)Nixola wrote:What is it?
In order to assign a player.box.player value, player.box must be a table, and it is not a table... I can't index it this way :/
Re: Questions about platformer game
print(type(player.box)) afret player.box=collider:etc
lf = love.filesystem
ls = love.sound
la = love.audio
lp = love.physics
lt = love.thread
li = love.image
lg = love.graphics
ls = love.sound
la = love.audio
lp = love.physics
lt = love.thread
li = love.image
lg = love.graphics
-
- Prole
- Posts: 19
- Joined: Fri Aug 31, 2012 8:32 am
Re: Questions about platformer game
Nixola wrote:print(type(player.box)) afret player.box=collider:etc
it prints out table :S:S:S i thought that it would print out shape..
But anyways its working now . Although i didn't fully get what is going on here :S:S:S
i assigned a shape type (collider:addRectangle(etc)) in player.box
then i assigned player.box.player=player which means that i actually indexed a shape type :S:S:S:S
Except if collider:addRectangle produces tables and not shapes
- Robin
- The Omniscient
- Posts: 6506
- Joined: Fri Feb 20, 2009 4:29 pm
- Location: The Netherlands
- Contact:
Re: Questions about platformer game
In Lua, basically everything is a table. HardonCollider (which I assume you're using) is written in Lua. Tables are really flexible.
Help us help you: attach a .love.
-
- Prole
- Posts: 19
- Joined: Fri Aug 31, 2012 8:32 am
Re: Questions about platformer game
Didn't know that to be honest . I just read the hardoncollider documentation concerning the shapes module, and thats why i discovered too, its indeed a table... And i do agree that they are flexible .Robin wrote:In Lua, basically everything is a table. HardonCollider (which I assume you're using) is written in Lua. Tables are really flexible.
Re: Questions about platformer game
Tables are essentially the core thing around all Lua is built. For successfully code in Lua you should start asap read and do even some Lua tutorials about tables. Unless you do that Lua/LOVE world and potentialities will stay "locked" for you.gregkwaste wrote:Didn't know that to be honest . I just read the hardoncollider documentation concerning the shapes module, and thats why i discovered too, its indeed a table... And i do agree that they are flexible .Robin wrote:In Lua, basically everything is a table. HardonCollider (which I assume you're using) is written in Lua. Tables are really flexible.
Re: Questions about platformer game
This book is all you need to know/learn about Lua programming. It was written by one of the founders of the language, and it is pretty easy and enjoyable to read. Buy it, borrow it, download it, steal it...heck, do what you want, but get a copy of it!
Lua is built around the concept of flexibility, and that comes from the fact that it has only one data structure (yes, you guessed it...) - tables. variables are tables, arrays are tables, functions can be thought of as a cell in a table, even the entire program you write is a table.
Lua is built around the concept of flexibility, and that comes from the fact that it has only one data structure (yes, you guessed it...) - tables. variables are tables, arrays are tables, functions can be thought of as a cell in a table, even the entire program you write is a table.
Did my comment help/offended you? Use the Karma button!!
LÖVEing each day...
LÖVEing each day...
-
- Prole
- Posts: 19
- Joined: Fri Aug 31, 2012 8:32 am
Re: Questions about platformer game
Thanks a lot for all the input, its an absolute relief for me that everything is a table just because i am very comfortable with using them and basicaly it was easy for me to understand everything as tables as well, and to be honest i definetely did not expect that EVERYTHING would be like that in lua .
I'll try to get somehow this book and find out every detail i am missing .
I'll try to get somehow this book and find out every detail i am missing .
- Roland_Yonaba
- Inner party member
- Posts: 1563
- Joined: Tue Jun 21, 2011 6:08 pm
- Location: Ouagadougou (Burkina Faso)
- Contact:
Re: Questions about platformer game
Or eventually, read the free online version.gregkwaste wrote:Thanks a lot for all the input, its an absolute relief for me that everything is a table just because i am very comfortable with using them and basicaly it was easy for me to understand everything as tables as well, and to be honest i definetely did not expect that EVERYTHING would be like that in lua .
I'll try to get somehow this book and find out every detail i am missing .
Who is online
Users browsing this forum: Ahrefs [Bot], Google [Bot] and 2 guests