Map Save Tech Demo

Showcase your libraries, tools and other projects that help your fellow love users.
User avatar
whitebear
Citizen
Posts: 86
Joined: Sun Mar 15, 2009 1:50 am

Map Save Tech Demo

Post by whitebear »

Basis of this tech demo is to create save & load system that I atempt to turn into a library when all the features I want are in.
You can download the version 4 it here:
polygonmaps2.love
Map saving tech test version 4
(7.38 KiB) Downloaded 274 times
Controls:
L = load
S = save
R = clear the map
LMB = drag to draw map elements.
RMB = spawn ball or reset it's position. (momentum does not reset)
MMB = Click at Three points to create polygon (do the polygons clockwise)
Key pad +/- = zoom
Arrows = move screen
1 = edit world 1 (red)
2 = edit world 2 (green)
Q = swap ball's world (red/green)
NOTE:
Mouse scroll zoom is bugged (actually forgot to remove ^^)

Now Here is the problem I am having. As you notice the two worlds and swapping ball's home between them enables unique puzzels to be made. But after you are donem, you sadly also notice that when you save it and then load it again, All the things in you save go to green world.
Don't worry, It was not saved wrongly (yes it saves the data about the world). It loads it wrongly. I just can't seem to find reason. It's probly something I should have noticed but I don't. If you can find what is causing this. Please inform me.
Last edited by whitebear on Wed Mar 25, 2009 4:44 pm, edited 5 times in total.
User avatar
S-Rave
Prole
Posts: 39
Joined: Wed Feb 25, 2009 4:41 pm

Re: Map Save Tech Demo

Post by S-Rave »

Cool! :) I really like the way to choose filename.

Also, maybe add a button to try out the level? Like have a bool to check if in devmode or not? :)
srejv
User avatar
whitebear
Citizen
Posts: 86
Joined: Sun Mar 15, 2009 1:50 am

Re: Map Save Tech Demo

Post by whitebear »

Well actually I had something like that in mind. And I almost complated that feature on first release.
Since you requested it I completed it.
Check the first post for updated version.
User avatar
appleide
Party member
Posts: 323
Joined: Fri Jun 27, 2008 2:50 pm

Re: Map Save Tech Demo

Post by appleide »

Pretty cool :)

Btw, mine crashed after playing with it for a while. Tried several times. It might be to do with drawing too many rectangles...
User avatar
whitebear
Citizen
Posts: 86
Joined: Sun Mar 15, 2009 1:50 am

Re: Map Save Tech Demo

Post by whitebear »

Might be for having too many shapes in one body.

If anyone knows function to set angle of shape, please tell me... Guite lost here. (note I don't mean SetAngle() function)
Edit: Reason for crash aparently was the diamond shape that was dropped in v2 so no worries.
User avatar
bartbes
Sex machine
Posts: 4946
Joined: Fri Aug 29, 2008 10:35 am
Location: The Netherlands
Contact:

Re: Map Save Tech Demo

Post by bartbes »

Nice, one thing though: when I press R to reset and I 'spawn' the ball, it still collides with the 'removed' shapes, meaning that it doesn't delete them,
User avatar
whitebear
Citizen
Posts: 86
Joined: Sun Mar 15, 2009 1:50 am

Re: Map Save Tech Demo

Post by whitebear »

Well here comes the third version fixing the "ghost" blocks bug and adding new feature:
Polygons!

Now clicking Middle mouse button at three places spawns a polygon.
NOTE: For some reason polygons in love physics need to be placed in clockwise order for them to work. There for always do so until someone can figure out the math for me. (I am too lazy to do it.)
User avatar
S-Rave
Prole
Posts: 39
Joined: Wed Feb 25, 2009 4:41 pm

Re: Map Save Tech Demo

Post by S-Rave »

whitebear wrote:NOTE: For some reason polygons in love physics need to be placed in clockwise order for them to work. There for always do so until someone can figure out the math for me. (I am too lazy to do it.)
It's probably because of clockwise winding and backface culling algorithms in opengl. :]
srejv
User avatar
whitebear
Citizen
Posts: 86
Joined: Sun Mar 15, 2009 1:50 am

Re: Map Save Tech Demo

Post by whitebear »

I already have the method I can flip it from anti-clockwise to clockwise if it is anti-clockwise down on paper but I think need some help stolen from kudo lib to do that.

I also have been working on the camera script for both Ninja Ball and This so soon maps can be made bigger and more detailed than before.
Also you will see loading feature for Ninja Ball in next release.
User avatar
hdon
Prole
Posts: 36
Joined: Tue Mar 17, 2009 10:54 pm
Location: Pittsburgh, PA, USA
Contact:

Re: Map Save Tech Demo

Post by hdon »

S-Rave wrote:
whitebear wrote:NOTE: For some reason polygons in love physics need to be placed in clockwise order for them to work. There for always do so until someone can figure out the math for me. (I am too lazy to do it.)
It's probably because of clockwise winding and backface culling algorithms in opengl. :]
You are correct
love-0.5-0/src/opengl/love_opengl.cpp wrote:

Code: Select all

// Cull backface
glEnable(GL_CULL_FACE); // Enable face culling (no need to render surfaces we can't see
glCullFace(GL_BACK); // Do not render back face.
Who knows why someone did this given (and even wrote comments contrary to) the claim that LÖVE is 2D-only.

A cut-and-paste job, perhaps? Tisk-tisk!

:monocle: :monocle: :monocle: :monocle: :monocle: :monocle: :monocle: :monocle: :monocle: :monocle: :monocle: :monocle: :monocle:
Post Reply

Who is online

Users browsing this forum: No registered users and 70 guests