fuccboiGDX

Showcase your libraries, tools and other projects that help your fellow love users.
User avatar
nodepond
Prole
Posts: 8
Joined: Wed Sep 19, 2012 3:16 pm
Location: Cologne, Germany
Contact:

Re: Mogamett

Post by nodepond »

Hi there. Mogamett looks really cool - more modular like the Zoetrope, that is a little bit too high level for my taste.

Here my question: I try to get the PhysicsBody-mixing running, but have problems doing so. Before getting into the details... It would be cool, to have a downloadable project, with example stuff in it - then maybe questions like this would become obsolete.

Here I define the Player-object.

Code: Select all

require 'mogamett/mogamett'

-- physics enabled entity template
Player = mg.class('Player', 'Entity')
Player:implement(mg.PhysicsBody)

function Player:new(world, x, y, settings)
    Player.super.new(self, world, x, y, settings)
    self:physicsBodyNew(world, x, y, settings)
end

function Player:update(dt)
    self:physicsBodyUpdate(dt)
end

function Player:draw()
    self:physicsBodyDraw()
end
When I try to initialize with that

Code: Select all

player = Player(mg.world, 100, 100,{})
I got the following error:
mogamett/mixins/PhysicsBody.lua:53 attempt to index a nil value

Going back to Player.lua line 9:

Code: Select all

self:physicsBodyNew(world, x, y, settings)
Any ideas, what could be wrong? I also tried different inits of the Player-object, like
player = Player.new(mg.world, 100, 100) or player = Player:new(mg.world, 100, 100,{})
User avatar
nodepond
Prole
Posts: 8
Joined: Wed Sep 19, 2012 3:16 pm
Location: Cologne, Germany
Contact:

Re: Mogamett

Post by nodepond »

Ohh.

I've got the suspicion, that somehow the mg.world was not fully initialized at the example above. I did try it in

Code: Select all

function love.load()
	mg.init()
	playerTest()
end
When I run the playerTest-method later during runtime, there is no error. So I guess it was just an init-issue. When calling it after mg.run() it seems to work.
User avatar
adnzzzzZ
Party member
Posts: 305
Joined: Sun Dec 26, 2010 11:04 pm
Location: Porto Alegre, Brazil

Re: Mogamett

Post by adnzzzzZ »

You're supposed to create entities using the createEntity function. http://mogamett.com/documentation/world ... on_methods
User avatar
nodepond
Prole
Posts: 8
Joined: Wed Sep 19, 2012 3:16 pm
Location: Cologne, Germany
Contact:

Re: Mogamett

Post by nodepond »

adnzzzzZ wrote:You're supposed to create entities using the createEntity function. http://mogamett.com/documentation/world ... on_methods
Ok, that was the secret! Thanks! Maybe it would be a good idea, to mention this creation-method at the PhysicyBody-documentation: http://mogamett.com/documentation/physicsbody/
User avatar
nodepond
Prole
Posts: 8
Joined: Wed Sep 19, 2012 3:16 pm
Location: Cologne, Germany
Contact:

Re: Mogamett

Post by nodepond »

I wrote a little parser, that converts tilemap-data from the "Pyxel"-pixeleditor (http://pyxeledit.com) to mogamett (the quite current version - there are no official versions yet, so it seems).

If anyones interested, here is the stuff:
https://gist.github.com/nodepond/5e71171ffbe2ec09aa03

Usage:
Run this script in the same folder, where you have exported the 'tilemap.json' from Pyxel.

The tilemap is named 'Layer 0'
The collisionmap is named 'Layer Collide'

It generates lua-code ready to c&p paste. There is an more accurate usage example in the ruby-file itself.
User avatar
Zilarrezko
Party member
Posts: 345
Joined: Mon Dec 10, 2012 5:50 am
Location: Oregon

Re: Mogamett

Post by Zilarrezko »

All of everyone's plugs, so many haha.

This is an awesome collaboration of everything, good too see everyone in the community likes it as well.
User avatar
adnzzzzZ
Party member
Posts: 305
Joined: Sun Dec 26, 2010 11:04 pm
Location: Porto Alegre, Brazil

Re: fuccboiGDX

Post by adnzzzzZ »

Released the latest version as fuccboiGDX: http://fuccboi.moe/

Tutorials
Examples
Documentation
User avatar
nodepond
Prole
Posts: 8
Joined: Wed Sep 19, 2012 3:16 pm
Location: Cologne, Germany
Contact:

Re: fuccboiGDX

Post by nodepond »

I am just curious... Why the renaming of Mogamett to fuccboiGDX? (I just get used to Mogamett.) And what does GDX stand for?
User avatar
adnzzzzZ
Party member
Posts: 305
Joined: Sun Dec 26, 2010 11:04 pm
Location: Porto Alegre, Brazil

Re: fuccboiGDX

Post by adnzzzzZ »

It doesn't stand for anything, but I answer why I used it in the FAQ
User avatar
nodepond
Prole
Posts: 8
Joined: Wed Sep 19, 2012 3:16 pm
Location: Cologne, Germany
Contact:

Re: fuccboiGDX

Post by nodepond »

I made an small update to the Pyxel Edit tilemap to fuccboiGDX-parser. http://www.nodepond.com/blog/779-pyxel- ... er-in-ruby
Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot] and 2 guests