Search found 51 matches

by 0x72
Mon Oct 05, 2015 1:27 pm
Forum: Support and Development
Topic: Bullet Generation
Replies: 2
Views: 643

Re: Bullet Generation

I'm not 100% sure if this is what you have a problem with but as far as I can see you never call createBullets() adding: function love.mousepressed() createBullets() -- actually it creates just one, shouldn't it be renamed to createBullet() ? end let me create (and draw) them although they still not...
by 0x72
Sun Sep 27, 2015 7:06 pm
Forum: Support and Development
Topic: Trying to make my own menu(issues)
Replies: 3
Views: 453

Re: Trying to make my own menu(issues)

you never load the menu again (only changing state) and you have some initialization (for player) in the LOAD_MENU in case of State == "Playing" so try: function StateChanger(dt) if love.keyboard.isDown("1") and State == "Menu" then State = "Playing" LOAD_MENU(dt) end end good luck with the game :) ...
by 0x72
Sat Jun 27, 2015 5:35 pm
Forum: Support and Development
Topic: TraceLine acting like a box
Replies: 1
Views: 379

Re: TraceLine acting like a box

Take a look into bump.lua from kikito - It's written in a simple and clean manner (better then anything i could produce), I recommend reading the whole thing - very interesting :) You can borrow this function from there: -- This is a generalized implementation of the liang-barsky algorithm, which al...
by 0x72
Fri Jun 26, 2015 7:27 am
Forum: Support and Development
Topic: Problem with scoping (different files)
Replies: 5
Views: 740

Re: Problem with scoping (different files)

First of all: It's simple now, I'd move forward. But if you feel like working on menu today (instead of let's say - gameplay) then instead of menu object (self) you could pass game to the interface, or you could even make game a global variable[1]. The issue there is that you don't know if game is t...
by 0x72
Thu Jun 25, 2015 7:23 pm
Forum: Support and Development
Topic: Problem with scoping (different files)
Replies: 5
Views: 740

Re: Problem with scoping (different files)

You have misspelled initialize in interface.lua - when you fix it, it'll work :)
by 0x72
Thu Jun 25, 2015 6:01 am
Forum: Support and Development
Topic: Problem with scoping (different files)
Replies: 5
Views: 740

Re: Problem with scoping (different files)

One of the ways might be something like that (direct one to one relation between the interface and the menu): function Menu:enteredState() self.interface = gui.Interface:new(self):loadFromFile("menu/main.lua") -- gui.Interface:new(self, "menu/main.lua") ? end local INTERFACE = class("INTERFACE") -- ...
by 0x72
Wed Jun 24, 2015 3:44 pm
Forum: Support and Development
Topic: Changing lines and color on strings fails
Replies: 3
Views: 398

Re: Changing lines and color on strings fails

tbh I'm not sure why you put an empty string to the result table in the fist place, I've changed in draw.string if v == "\n" or v == "" then to if v == "\n" then and it works as expected (i.e. it put only as many newlines as there is in the sting, because the later of the duplicated newlines is "") ...
by 0x72
Wed Jun 24, 2015 9:08 am
Forum: Support and Development
Topic: Changing lines and color on strings fails
Replies: 3
Views: 398

Re: Changing lines and color on strings fails

v in the loop in the draw.string function is never equal to "\n" So the scan.string fail somewhere: if you add elseif chr == '\n' table.insert(result, chr) to the loop inside scan.string then it'll work The part near `elseif skip then` in the same function assumes that you have "\\n" (two characters...
by 0x72
Thu Jun 18, 2015 8:44 pm
Forum: Support and Development
Topic: My enemies keep moving right.
Replies: 4
Views: 600

Re: My enemies keep moving right.

Hi! 1) There is probably no reason to divide enemy x and y by 2 when comparing it with centre position of the player (if there is the there is the issue :)) 2) you compare x and y but then only update xvel of the enemy, not sure if enemy is list of enemies (suggested by the loop) or single one (sugg...
by 0x72
Thu Jun 18, 2015 8:37 pm
Forum: Support and Development
Topic: Attempt to compare function with number
Replies: 5
Views: 1002

Re: Attempt to compare function with number

The file you've posted and the repo differ, but it looks like there is something screwed up with your world.update. Try something more like that: function world.update( dt ) for i, v in ipairs(worldData) do v.segmentx = v.segmentx - 0.2 * love.graphics.getWidth() * dt if v.segmentx < 0 then v.segmen...