Tilt - physics puzzler (r11)

Show off your games, demos and other (playable) creations.
User avatar
Tesselode
Party member
Posts: 555
Joined: Fri Jul 23, 2010 7:55 pm

Tilt - physics puzzler (r11)

Post by Tesselode »

You know those labyrinth things? The ones where you tilt the thingy around to get the ball to go around holes? OK, well imagine a 2D computer game version of that. Where all of the platforms rotate separately. And you can only rotate the one that the ball touched last.

Download Windows binaries here: http://tesselode.110mb.com/games/tilt-windows.zip
Or download the source: http://tesselode.110mb.com/games/tilt-source.zip

(or just use the attachment)

How to play: hold down the left mouse button and move the mouse to rotate platforms. Get the ball to the green square. Don't go past the left, right, or bottom edge of the screen. Avoid spikes.

Image

Image

Image

__________________________________________________________________________________________________________________________________

Level making guide
Hey guess what, in the current release, you can make levels!

First create a text file in the "custom" folder with the file extension ".tilt". Then start typing in it!
(The "custom" folder is in %appdata%/love/tesselode_tilt on Windows and ~/.love/tesselode_tilt on LInux.)

Each line is a different object. The syntax is as follows:

[x position],[y position],[object type],[parameters for object separated by commas]

The different object types:
-"ball" - the ball you have to guide to the goal (no parameters)
-"goal" - the goal you have to guide the ball to (no parameters)
-"spike" - spike balls. Don't touch these! (no parameters)
-"wall" - uninteractive wall thingy. (no parameters)
-"platform" - a rotatable platform. This can have one or more sets of 4 parameters, each of which represents a rectangle that makes up the platform.
The parameters are, in order: relative x position, relative y position, width, and height.
-"spring" - the ball bounces when it lands on one of these. (no parameters)
-"jet" - an air jet that pushes the ball around. Has 1 parameter, which is one of four directions, "left," "right," "up," or "down."

Tips:
-The size of every level is 800 by 600 pixels.
-Don't let platforms rotate too far off the screen. Otherwise they might stop rotating.
-Try not to let platforms collide with each other. Bad stuff isn't guaranteed to happen, but weird stuff might.
-All the shapes on a platform should touch each other. We don't want floaty shapes.
-Walls, spike balls, and springs all have a size of 30x30 pixels.

Feel free to post level designs in this topic! I would like people besides me to design some levels for the final version of Tilt, since that will probably make the game more interesting.
Attachments
tilt-r11.love
(205.04 KiB) Downloaded 352 times
Last edited by Tesselode on Sat Oct 02, 2010 7:36 pm, edited 13 times in total.
User avatar
TechnoCat
Inner party member
Posts: 1611
Joined: Thu Jul 30, 2009 12:31 am
Location: Denver, CO
Contact:

Re: Tilt - physics puzzler

Post by TechnoCat »

I assume it stops because of garbage collection.
Also, the x-axis/y-axis controls seem to do the same thing.
User avatar
Tesselode
Party member
Posts: 555
Joined: Fri Jul 23, 2010 7:55 pm

Re: Tilt - physics puzzler

Post by Tesselode »

I've heard a lot about the garbage collector. What exactly does it do, and how can I get it to stop screwing up the movement (if it is)?
User avatar
kikito
Inner party member
Posts: 3153
Joined: Sat Oct 03, 2009 5:22 pm
Location: Madrid, Spain
Contact:

Re: Tilt - physics puzzler

Post by kikito »

"garbage" on this context means "things that are not referenced by variable".

Lua understands that an object stops being used when the last reference to it is removed from memory. The garbage collector is a periodical process that goes through all the lua objects in your app and deletes them from memory if they are not referenced.

For example:

Code: Select all

local a = {'a','b','c'} -- the table is created and referenced by the 'a' variable
local b = a -- now it has two references: a and b
a = nil -- the table only has one reference now: b
b = nil -- the table isn't referenced any more
-- from this point on, the table can be garbage-collected
Technocat means that when you create your physical objects you are probably not assigning them to any variable - you are probably "just leaving them there", like this:

Code: Select all

   love.physics.newBody(...)
So when the garbage collector is fired, it detects that the body isn't referenced, and eliminates it from memory. If you don't want this to happen, assign it to a global variable or insert it on a global array, like so:

Code: Select all

   body1 = love.physics.newBody(...)
When I write def I mean function.
User avatar
Tesselode
Party member
Posts: 555
Joined: Fri Jul 23, 2010 7:55 pm

Re: Tilt - physics puzzler

Post by Tesselode »

I am assigning the bodies to variables. I don't think the garbage collector is the problem, as the rotation stops working at different times. In fact, if I don't move the mouse at all and I wait for the ball to land on the platform, the rotation always stops working. I'm thinking this might have something to do with body:setAngularVelocity.
User avatar
bartbes
Sex machine
Posts: 4946
Joined: Fri Aug 29, 2008 10:35 am
Location: The Netherlands
Contact:

Re: Tilt - physics puzzler

Post by bartbes »

Or maybe the bodies fall asleep?
User avatar
Xkeeper
Prole
Posts: 40
Joined: Wed Aug 04, 2010 2:49 am
Location: Henderson, Nevada, US
Contact:

Re: Tilt - physics puzzler

Post by Xkeeper »

Yes, the objects go to sleep.

This is easily fixable:

Code: Select all

function love.load()
	world=love.physics.newWorld(love.graphics.getWidth(),love.graphics.getHeight())
	world:setGravity(0,500)
	world:setAllowSleep(false);
	...
That will make it so no objects go to sleep.
osuf oboys
Party member
Posts: 215
Joined: Sun Jan 18, 2009 8:03 pm

Re: Tilt - physics puzzler

Post by osuf oboys »

Ah, that's original. I think you have plenty of opportunities for interesting puzzles if you do not restrict yourself to only and always being able to rotate platforms. You could also make e.g. platforms that can be moved along a pre-designed path or tatic ones that cannot be moved at all. Complicated pieces involving several objects through joints, e.g., a motorless obstacle attached to a platform by a rope. It might also be fun to involve more than one ball. One design question is whether there will be any direct ball interaction, e.g. the player slowing it down on a platform, or simply having to be quick about moving the platform before the ball touches something else.

Only having <-type platforms that can be rotated is not enough in itself to create a puzzle because, on the logical side, the vertex space is roughly equal to the number of platforms and hence easy. On the other hand, it can be still be a most challenging game since it requires a good eye, reflexes, and skillful control.
If I haven't written anything else, you may assume that my work is released under the LPC License - the LÖVE Community. See http://love2d.org/wiki/index.php?title=LPC_License.
User avatar
Tesselode
Party member
Posts: 555
Joined: Fri Jul 23, 2010 7:55 pm

Re: Tilt - physics puzzler

Post by Tesselode »

Just uploaded a new version.

http://tesselode.110mb.com/games/tilt.zip

I'm trying to get a level creation system started, and it's currently broken. You'll probably get the following error:

scripts/loadlevel.lua:56: 'for' limit must be a number

If anyone can help me fix it, that would be great. And there will probably be more errors after that, so don't hurt yourself trying to fix those. Also, I'm attaching the .love file to make your lives easier, but knowing the forum, the link will break in a day or two.
Attachments
tilt.love
(1.92 KiB) Downloaded 312 times
giniu
Party member
Posts: 221
Joined: Mon Nov 30, 2009 4:44 pm

Re: Tilt - physics puzzler

Post by giniu »

Tesselode wrote:Just uploaded a new version.

http://tesselode.110mb.com/games/tilt.zip

I'm trying to get a level creation system started, and it's currently broken. You'll probably get the following error:

scripts/loadlevel.lua:56: 'for' limit must be a number

If anyone can help me fix it, that would be great. And there will probably be more errors after that, so don't hurt yourself trying to fix those. Also, I'm attaching the .love file to make your lives easier, but knowing the forum, the link will break in a day or two.
well, add print before it to see what's up - you will see that the shape_amount[a] is nil. It means you don't set it up correctly. Look at

Code: Select all

if object_type=="platform" then
object_type is a list, so something isn't right here, correct?
Post Reply

Who is online

Users browsing this forum: No registered users and 35 guests