Search found 478 matches

by Azhukar
Thu Oct 26, 2017 11:19 am
Forum: Support and Development
Topic: Inventory help in an RPG game
Replies: 46
Views: 12264

Re: Inventory help in an RPG game

Also congrats to GameDummy for bumping a 4 year old thread! :megagrin: I will never understand forum culture obsession with thread age. The entire point of the forum structure is to provide easy access to all topics ever made on it, but somehow someone came to the conclusion that the idea that 'bum...
by Azhukar
Wed Oct 25, 2017 1:46 pm
Forum: Support and Development
Topic: buggy table handling
Replies: 6
Views: 1597

Re: buggy table handling

thanks for responding so quickly. But the value blocs[1] is still equal to 0 even if it was supposed to be two because i declared it with blocs[id].x, blocs[id].y, and blocs[id].sprite. It is not equal to 0, it is equal to nil. This is what you're doing: blocs = {} blocs[1] = 123 print(blocs[1]) --...
by Azhukar
Wed Oct 25, 2017 1:02 pm
Forum: Support and Development
Topic: buggy table handling
Replies: 6
Views: 1597

Re: buggy table handling

Code: Select all

blocs = {}
This creates a new table each time it is called. You're calling the function twice, meaning you're creating 2 different tables, then only indexing the last created one. Declare the blocs table outside of newCollisionBox function.
by Azhukar
Wed Oct 25, 2017 12:57 pm
Forum: Support and Development
Topic: Inventory help in an RPG game
Replies: 46
Views: 12264

Re: Inventory help in an RPG game

İ will try to add images for the inventory myself, but if you come up with a way to do that and share it i would appreciate that as well. The same way the items are differently colored you can specify different images. The code already includes the conditional construct for that behavior in the dra...
by Azhukar
Mon Oct 23, 2017 8:56 pm
Forum: Support and Development
Topic: Lighters pause in midpoints
Replies: 10
Views: 3373

Re: Lighters pause in midpoints

HedgeHog builder wrote:
Mon Oct 23, 2017 7:51 pm
How would I select the closest one?
Here is a tutorial for a minimum value algorithm: http://www.programming4beginners.com/tu ... -algorithm

You'll have to iterate through all potential targets and apply that to pick the one with the shortest distance.
by Azhukar
Mon Oct 23, 2017 8:51 pm
Forum: Support and Development
Topic: love - supporting multiple directories
Replies: 8
Views: 2174

Re: love - supporting multiple directories

'arg' is a global variable containing all arguments passed to love executable, you can access it from conf.lua or anywhere else.
by Azhukar
Mon Oct 23, 2017 2:01 pm
Forum: Support and Development
Topic: Inventory help in an RPG game
Replies: 46
Views: 12264

Re: Inventory help in an RPG game

Thank you for that, but can you guys tell me a way to draw this on the actual game screen ? local myInventory = {food = 10,sword = 4,coin = 50,axe = 2,shield = 1,armor = 40} local function drawItem(item,itemWidth,itemHeight) if (item == "food") then love.graphics.setColor(0,128,0,255) elseif (item ...
by Azhukar
Mon Oct 23, 2017 1:40 pm
Forum: Support and Development
Topic: Anim8 Issue: There is no frame for x=1, y=2
Replies: 3
Views: 1088

Re: Anim8 Issue: There is no frame for x=1, y=2

Here is a guide on the library you're using, which you didn't read: https://github.com/kikito/anim8 The proper way to create your animation according to the above is this: left = anim8.newAnimation(g(1,1, 2,1, 3,1, 4,1), 1.0), right = anim8.newAnimation(g(1,2, 2,2, 3,2, 4,2), 1.0) In your code you s...
by Azhukar
Mon Oct 23, 2017 1:02 am
Forum: Support and Development
Topic: love.graphics.newimage returns nil in module
Replies: 3
Views: 1190

Re: love.graphics.newimage returns nil in module

Here's the sequence of events: 1. 'require' will run the file, meaning it will define (A)love.load to be a function you specified 2. function (B)love.load will get reassigned in main.lua after the require 3. framework will then call (B)love.load This means (A)love.load from the 'require' will never ...
by Azhukar
Mon Oct 23, 2017 12:56 am
Forum: Support and Development
Topic: Collision bug
Replies: 2
Views: 903

Re: Collision bug

In server.lua you create your box2d world at line 203, then you add all your static fixtures, but then you AGAIN create a box2d world at line 242. Which means the terrain is in a different world from your cars. Also your variable naming scheme is bad, using single letter global variables everywhere ...