Search found 10 matches
- Mon Jun 01, 2020 4:19 pm
- Forum: Support and Development
- Topic: Collision of sub-table objects
- Replies: 1
- Views: 5273
Collision of sub-table objects
I am making a small game where two objects are there (i) bigBox & (2) avtarGod. Now 'avtarGod' is having one subtable object named 'arrows'. The object 'bigBox' is like an enemy entity. Both bigBox & avtarGod objects are moving opposite direction and crossing each other. Subtable object 'arr...
- Mon Jun 01, 2020 4:05 pm
- Forum: Support and Development
- Topic: Object orientation & code complexity [Multiplayer 4X]
- Replies: 13
- Views: 19895
Re: Object orientation & code complexity [Multiplayer 4X]
Hi, Sorry its my mistake to understand how to start a new thread.... But I can't understand your solution...all I wanted is to see the sub-table 'field' values on my screen while it moves, i.e. 'field' values of object 'Box'. As suggested by you I have made the following changes as below : temptable...
- Sun May 31, 2020 7:19 am
- Forum: Support and Development
- Topic: Object orientation & code complexity [Multiplayer 4X]
- Replies: 13
- Views: 19895
Displaying sub-table values of moving object
I am checking if I can display table values of an moving object and which I coded as below : temptable = {} temptable.x = 710 temptable.y = 20 temptable.width = 40 temptable.height = 30 function love.draw() local coXX = 100 for i,v in pairs(temptable) do -- if instead we do ipairs then the values of...
- Sun May 31, 2020 4:08 am
- Forum: Support and Development
- Topic: love 0.9.0 tables
- Replies: 11
- Views: 10480
ipairs & pairs display issues in draw function
Thanks for the reply. Yes, I couldn't open the image either, after posting it !! Dont know why !! By the way, I have started a new query / thread "ipairs & pairs display issues in draw function" but it seems going back to the earlier query / thread (i.e. love 0.9.0 tables)... can you t...
- Sat May 30, 2020 7:24 pm
- Forum: Support and Development
- Topic: love 0.9.0 tables
- Replies: 11
- Views: 10480
ipairs & pairs display issues in draw function
When I try to get the table content with 'pairs' as below : temptable = {} temptable.x = 10 temptable.y = 20 temptable.width = 40 temptable.height = 30 function love.draw() local coXX = 200 for i,v in pairs(temptable) do love.graphics.print("value of i : ", 120, 220) love.graphics.print(&q...
- Sat May 30, 2020 6:38 am
- Forum: Support and Development
- Topic: For loop problem
- Replies: 11
- Views: 8763
Re: For loop problem
Another question - is there any need to use the 'break' in this loop ? is there a specific reason for this ? I can see If I don't use 'break' here it still works perfectly.
Code: Select all
if CheckCollision(x, y, 0, 0, v.x, v.y, v.width, v.height) then
inside_small_boxes = true
break
end
- Sat May 30, 2020 6:29 am
- Forum: Support and Development
- Topic: For loop problem
- Replies: 11
- Views: 8763
Re: For loop problem
Thanks '4vZEROv'. Now it is showing click events inside as well as outside the small boxes. Perfect. I never thought to write the code in mouse pressed function and check. I was writing in update function. Thanks a lot. function love.mousepressed(x, y) local inside_small_boxes = false for i, v in ip...
- Fri May 29, 2020 7:09 pm
- Forum: Support and Development
- Topic: For loop problem
- Replies: 11
- Views: 8763
Re: For loop problem
Thanks. But as soon as the program starts, without any click, it shows ' you have clicked outside the rectangle'. Moreover I have to keep the mouse button pressed inside the small boxes to get a response that I have clicked inside the mouse button. Can you please rephrase the codes in such a way tha...
- Thu May 28, 2020 4:22 pm
- Forum: Support and Development
- Topic: For loop problem
- Replies: 11
- Views: 8763
Re: For loop problem
I have already got mouse click event inside the small rectangles, at the same time I want to check if I can get mouse click event outside the small rectangles. (please ignore the big rectangle). That means when I click inside any small rectangles I will get a text display 'mouse clicked inside small...
- Wed May 27, 2020 6:06 am
- Forum: Support and Development
- Topic: For loop problem
- Replies: 11
- Views: 8763
problem with multiple object access with mouse in ipairs
Hi, I am new around here. Recently while experimenting with 'ipairs' I am finding an issue which I can't solve. May I request a slight, bit help from the experts.... This code is written in 'main.lua' file & I am finding a problem - which I can't overcome... I created a table for a bigger box. I...