Squario: A squary survival horror

Show off your games, demos and other (playable) creations.
User avatar
ZenX2
Citizen
Posts: 89
Joined: Wed Nov 17, 2010 5:35 am

Squario: A squary survival horror

Post by ZenX2 »

This is Squario:

Image

Version Info

- = Added Feature
+ = Changed Feature
| = A problem

Version 0.1.0 [12/2/10]
-Basic Graphic (Squario, Grass)
-Basis for entity and image systems
-Not much else

Version 0.1.1 [12/3/10]
-New Graphics!
+A slightly better class library (Thanks Mud)
+Squario will fall
|Squario will not collide with the ground.

The Goal:
To make a platformer where you jump, spin, and fall to the end of the level.
If you hit the edge of platform, you'll fall off, not stand with your foot in the air like an idiot.
Attachments
squario.love
(10.39 KiB) Downloaded 169 times
Last edited by ZenX2 on Sat Dec 04, 2010 3:21 am, edited 3 times in total.
User avatar
Mud
Citizen
Posts: 98
Joined: Fri Nov 05, 2010 4:54 am

Re: Squario: The squariest platformer in LOVE.

Post by Mud »

Player:Think is never being called, only the base class method is. I took a look at the class library and it made me want to punch a baby, so you're on your own there... >.>
User avatar
kikito
Inner party member
Posts: 3153
Joined: Sat Oct 03, 2009 5:22 pm
Location: Madrid, Spain
Contact:

Re: Squario: The squariest platformer in LOVE.

Post by kikito »

Mud wrote:Player:Think is never being called, only the base class method is. I took a look at the class library and it made me want to punch a baby, so you're on your own there... >.>
Poor baby. I see that he is using a modified version of an old middleclass. Your punching instincts come from the fact that he uses middleclass, that his version isn't up to date, or that he's done custom changes? Warning: The first option might hurt my feelings.

Speaking about modifications: guys, if you make them, don't be shy. Make a github fork, publicly, so other people can see them, re-use, comment and correct! ... Also it would make me happy. Ego boost!
ZenX2 wrote:I've been trying to figure this out for a few hours, and haven't had much luck. Here's the .love if you think you can help, which would be lovely.
I think that your problem is that you are using super the wrong way on ents/player and ents/ground.
You have this:

Code: Select all

self.super:__init(p, 32, 32, 0, 0)
The normal way super should be used is this:

Code: Select all

super.__init(self, p, 32, 32, 0, 0)
Your modification on middleclass (line 65, theSubclass.super = theClass) doesn't make those two lines equivalent. The main reason is that the first parameter of the function must be 'self'. Your implementation is passing the superclass as the first parameter instead.

Similarly, I had to change this line in ents/player:

Code: Select all

self.super:Think()
to this:

Code: Select all

super.Think(self)
for the same reasons as above.

(Incidentally, I also had to add additional parameters to love.physics.newworld instead of just w,h. I think this might be LÖVE 0.7 a bug. I'm using the unstable PPA)

When I did those changes, the red box started falling down.

Some comments:
  • Be more strict with your naming conventions. If the file is called entbase.lua, then I'd expect the class defined inside it to be called 'EntBase', not just 'Ent'. Also, there is a table called images next to another one called Images ( :crazy: ).
  • A method called 'Think' should not be invoking love.graphics.draw. It should really be just updating positions, removing health, handling collisions, etc. Drawing stuff should be put inside a method called 'Draw' or similar. (I also started having a method called 'think' in my Actors, but I ended up changing it to 'update' so it mimicked the love functions better)
  • I don't think the separation between 'Images' and 'Entities' has any good reason to be. Your code will be simpler and faster to implement if you just add an 'image' attribute to your Ents, as well as a "Draw" method.
  • You declare the ents table inside main.lua, but then use it inside core/entbase. Consider putting ents inside core/entbase instead; then add a class method called Ent:ThinkAll() and/or Ent:DrawAll(). This way your code will be more encapsulated.

Only one more thing: Good luck! Making a physics-based platformer is pretty much the holy grail of LÖVE development...
When I write def I mean function.
User avatar
zac352
Party member
Posts: 496
Joined: Sat Aug 28, 2010 8:13 pm
Location: In your head.
Contact:

Re: Squario: The squariest platformer in LOVE.

Post by zac352 »

Have you tried dividing the positions by 16? :crazy:
Hello, I am not dead.
User avatar
bartbes
Sex machine
Posts: 4946
Joined: Fri Aug 29, 2008 10:35 am
Location: The Netherlands
Contact:

Re: Squario: The squariest platformer in LOVE.

Post by bartbes »

kikito wrote:(Incidentally, I also had to add additional parameters to love.physics.newworld instead of just w,h. I think this might be LÖVE 0.7 a bug. I'm using the unstable PPA)
It is most certainly not a bug, it's an API change.
User avatar
kikito
Inner party member
Posts: 3153
Joined: Sat Oct 03, 2009 5:22 pm
Location: Madrid, Spain
Contact:

Re: Squario: The squariest platformer in LOVE.

Post by kikito »

bartbes wrote:It is most certainly not a bug, it's an API change.
Well on that case the wiki needs some rewriting. Please confirm: On 0.6.2 we had two function signatures, but on 0.7.0 we'll have just one, correct?
When I write def I mean function.
User avatar
TechnoCat
Inner party member
Posts: 1611
Joined: Thu Jul 30, 2009 12:31 am
Location: Denver, CO
Contact:

Re: Squario: The squariest platformer in LOVE.

Post by TechnoCat »

kikito wrote:
bartbes wrote:It is most certainly not a bug, it's an API change.
Well on that case the wiki needs some rewriting. Please confirm: On 0.6.2 we had two function signatures, but on 0.7.0 we'll have just one, correct?
rude wrote:Removed newWorld(w, h). Added newWorld(x1, y1, x2, y2).
http://bitbucket.org/rude/love/changeset/5fc0273fb4a9



I am unable to play because of the newWorld incorrect parameters stuff. I'm on 0.7.0 Ubuntu unstable PPA.
User avatar
ZenX2
Citizen
Posts: 89
Joined: Wed Nov 17, 2010 5:35 am

Re: Squario: The squariest platformer in LOVE.

Post by ZenX2 »

Ah, having an x1, y1, x2, y2 makes much more sense than just a width and height.
And thanks for the C&C :crazy:
User avatar
ZenX2
Citizen
Posts: 89
Joined: Wed Nov 17, 2010 5:35 am

Re: Squario: The squariest platformer in LOVE.

Post by ZenX2 »

kikito, could you upload your edited version? I tried making the changes you suggested and it's not working :P
User avatar
kikito
Inner party member
Posts: 3153
Joined: Sat Oct 03, 2009 5:22 pm
Location: Madrid, Spain
Contact:

Re: Squario: The squariest platformer in LOVE.

Post by kikito »

Sorry, no :( . I deleted it right when I finished.
When I write def I mean function.
Post Reply

Who is online

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