Search found 56 matches

by nikneym
Sat Jun 06, 2020 4:53 pm
Forum: Support and Development
Topic: Accessing all the metatables created in a table
Replies: 3
Views: 6682

Re: Accessing all the metatables created in a table

The particles inside the array are not metatables. They are all tables and all of them have the same metatable, the `particle` table. I understand it now. I thought lua creates inner tables to that one main table and didn't know what we create is actually a seperate table. Thank you so much. I'm su...
by nikneym
Sat Jun 06, 2020 12:21 pm
Forum: Support and Development
Topic: Accessing all the metatables created in a table
Replies: 3
Views: 6682

Accessing all the metatables created in a table

Same question above! I was trying to implement Daniel Shiffman's simple p5.js particle system ( https://www.youtube.com/watch?v=UcdigVaIYAk ) and had this question. My code looks like this: particle.lua local particle = {} particle.__index = particle function particle.new(x, y) local self = setmetat...
by nikneym
Sun May 10, 2020 5:49 am
Forum: Support and Development
Topic: [Solved][Includes Example] Checking collisions and jumping around
Replies: 7
Views: 4601

Re: [Solved][Includes Example] Checking collisions and jumping around

Well, I went ahead and read all the examples made by Sheepolution. I copied his collision check algorithm into my prototype. He uses classic.lua OOP system and because I'm prototyping, I made a non-OOP tile collision check for everyone who may struggle with this in the future (Jumping in the example...
by nikneym
Wed Apr 29, 2020 7:36 pm
Forum: Support and Development
Topic: [Solved][Includes Example] Checking collisions and jumping around
Replies: 7
Views: 4601

Re: Checking collisions and jumping around

I tried bump.lua before and I'm sure it can create what I want but I want to make my own platformer collision detection. It don't have to be something super-realistic, just usual NES games-style platformer collisions. Are there any examples or sources about it?
by nikneym
Tue Apr 28, 2020 12:10 pm
Forum: Support and Development
Topic: [Solved][Includes Example] Checking collisions and jumping around
Replies: 7
Views: 4601

[Solved][Includes Example] Checking collisions and jumping around

Solved! Here is a simple collision check in tile-based universe. local map = { {0, 0, 0, 0, 0}, {0, 0, 0, 0, 0}, {0, 0, 0, 1, 0}, {0, 0, 0, 0, 0}, {1, 1, 1, 1, 1}, } local TILE_WIDTH = 8 local TILE_HEIGHT = 8 local player = { x = 10, y = 10, w = 8, h = 8, speed = 50, } player.last = { x = player.x, ...
by nikneym
Fri Feb 08, 2019 9:55 pm
Forum: Support and Development
Topic: [Solved] Collision Check in 2D Platformer
Replies: 5
Views: 5836

Re: [Need help] Collision Check in 2D Platformer

it works great now. also, thanks for the ipairs() mechanic man!
by nikneym
Wed Feb 06, 2019 9:16 am
Forum: Support and Development
Topic: [Solved] Collision Check in 2D Platformer
Replies: 5
Views: 5836

Re: [Need help] Collision Check in 2D Platformer

i still couldn't make it. i think i understand the logic but what's the difference between for ipairs() and single for loop? in order to create the map, do i have to write every boxes' x and y one by one?

by the way, i'm not an english speaker too :D
by nikneym
Sun Feb 03, 2019 8:01 pm
Forum: Support and Development
Topic: [Solved] Collision Check in 2D Platformer
Replies: 5
Views: 5836

[Solved] Collision Check in 2D Platformer

Hi all. I've been trying to understand basic platformer mechanics like jumping. Thanks to this post: https://love2d.org/wiki/Tutorial:Baseline_2D_Platformer i got the basics about it but there is a major problem. I've tried to make platformer like this: --might be weird but... lp=love.graphics; lk=l...
by nikneym
Mon Jan 21, 2019 2:17 am
Forum: Support and Development
Topic: Hearthstone-like card hold mechanic?
Replies: 3
Views: 3275

Hearthstone-like card hold mechanic?

Hey guys, its been awhile since i last asked a question, huh? so what are we waiting for! I'm working on a bakugan-like game and i'm trying to make card holding mechanic that similar to hearthstone. I made something like that: cards=0; lp=love.graphics; function love.keypressed(key) if key=="w&...
by nikneym
Wed Nov 15, 2017 7:38 pm
Forum: Libraries and Tools
Topic: Nimbus, Animation Lib
Replies: 4
Views: 3752

Re: Nimbus, Animation framework

You're right. I'm learning english by the help of this forum actually. And i didn't know how to call it at first (framework, lib, etc.) Also there is a bug in the newSheet function i was trying it and i forget to change it back. Gonna fix it! Thank you for your comment.