Search found 5 matches

by SunnyCloudySkies
Sun Aug 23, 2020 12:14 pm
Forum: Support and Development
Topic: [Solved] Initialising parent portion of an inherited class using hump
Replies: 4
Views: 2739

Re: Initialising parent portion of an inherited class using hump

@pgimeno Ah! That makes so much sense! Thank you so much for your help :awesome:
by SunnyCloudySkies
Sun Aug 23, 2020 6:58 am
Forum: Support and Development
Topic: [Solved] Initialising parent portion of an inherited class using hump
Replies: 4
Views: 2739

Re: Initialising parent portion of an inherited class using hump

Can you post a simple self-contained example demonstrating the issue? The simpler the better. Yes, sure! Here is a simple example using objects that print text to the screen: Parent class: NewText = Class() function NewText:init(text) self.text = text end function NewText:render() love.graphics.pri...
by SunnyCloudySkies
Sat Aug 22, 2020 12:21 pm
Forum: Support and Development
Topic: [Solved] Initialising parent portion of an inherited class using hump
Replies: 4
Views: 2739

[Solved] Initialising parent portion of an inherited class using hump

Hi all! I seem to have a problem inheriting the 'parent' portion of a class using class.lua (hump). Here is the relevant code: For the parent class: Npc = Class{} function Npc:init(map, spritesheet, width, height, xPos, yPos) self.walking_speed = 90 -- supports npc placement self.x = xPos or math.fl...
by SunnyCloudySkies
Mon Aug 17, 2020 9:04 am
Forum: Support and Development
Topic: [SOLVED] Locking user key inputs?
Replies: 2
Views: 1484

Re: Locking user key inputs?

There are several ways to tackle this: A combination of a State Machine + Making Input Detection Separate from the Animation would be my personal choice. In your case, you seem to have your animation code tied to your Inputs. Try transfering that into the movement code (since that doesn't get affec...
by SunnyCloudySkies
Sun Aug 16, 2020 9:54 am
Forum: Support and Development
Topic: [SOLVED] Locking user key inputs?
Replies: 2
Views: 1484

[SOLVED] Locking user key inputs?

Hi there forums! I'm relatively new to lua and love2d, and I'd like some help! I've made a player class which allows players to control sprites on screen with arrow keys. Using this player class, I have made a cutscene that moves the sprite across a map. However, if the user presses any of the arrow...