Search found 3 matches

by cfazzini
Mon Sep 18, 2017 2:59 pm
Forum: General
Topic: Suggestion to refactor this
Replies: 2
Views: 1912

Suggestion to refactor this

Is there a better way to refactor this. Ive got the following line: player = require('modules/player')('wizard') In modules/player.lua . I’ve got: function health(class) if class == 'wizard' then return 80 elseif class == 'warrior' then return 100 end end function mana(class) if class == 'wizard' th...
by cfazzini
Sun Sep 17, 2017 11:03 am
Forum: General
Topic: How to separate concerns?
Replies: 7
Views: 5123

How to separate concerns?

Lately, I've been following this tutorial on Youtube. Everything was created in a single file called main.lua There were things like player and enemy that seemed like they could have been moved out of main.lua. I come from Ruby, and I like the fact that I can encapsulate logic into classes. Is there...
by cfazzini
Sun Sep 17, 2017 2:47 am
Forum: General
Topic: Slack channel
Replies: 1
Views: 1857

Slack channel

Hi Lua members, Wanted to get into Love2d and Lua development. I'm an avid user of IRC and more-so Slack. I've been using IRC for several years now and have since moved over to Slack. Nothing wrong with IRC. Everyday, however, I see myself spending more time on Slack. Slack already has a great numbe...