Zoetrope, a starter kit for LOVE

Showcase your libraries, tools and other projects that help your fellow love users.
poke50uk
Prole
Posts: 2
Joined: Tue Oct 09, 2012 7:46 am

Re: Zoetrope, a starter kit for LOVE

Post by poke50uk » Tue Oct 09, 2012 7:57 am

Hi klembot,
love quick it is to get something working with this bit of kit...

do have one request though

I'm finding it difficult to see how I can implement a rotation of the camera, for example.. when I press right - I want my Tiled map I create rotates by 90Deg.

I tried just throwing in "hump" on some of your early examples
http://vrld.github.com/hump/#Camera-camera:draw

but don't feel confident enough to just start messing with Zoetrops files to try and see why it's not working. Had a rough debug but I'm new to Love2D as a whole.. very different graphics functions than what I'm used to.

Is it possible you can implement a camera. or rotate map function? I can see this being useful for a few games

User avatar
klembot
Prole
Posts: 30
Joined: Tue Apr 24, 2012 12:41 am

Re: Zoetrope, a starter kit for LOVE

Post by klembot » Tue Oct 09, 2012 8:00 pm

Compost wrote:Thanks for putting this together. I'm just learning LOVE and Lua, and finding this quite helpful to get things up and running quickly. It's appreciated.
(e.g. you no longer need to specify a x, y, and rotation velocity if you just want one
This is true for "drag", but for "acceleration", I get errors if I don't include all three.
This one snuck out at the release, but it should be fixed in the most recent build, e.g. https://bitbucket.org/klembot/zoetrope/ ... e045c3.zip. Gonna do a 1.2.1 in a bit once any other big bugs shake out.

User avatar
klembot
Prole
Posts: 30
Joined: Tue Apr 24, 2012 12:41 am

Re: Zoetrope, a starter kit for LOVE

Post by klembot » Tue Oct 09, 2012 8:03 pm

poke50uk wrote:Hi klembot,
I'm finding it difficult to see how I can implement a rotation of the camera, for example.. when I press right - I want my Tiled map I create rotates by 90Deg.

I tried just throwing in "hump" on some of your early examples
http://vrld.github.com/hump/#Camera-camera:draw
Someone else asked for a zoom in/out, too... both seem like reasonable requests. I tried something really really basic for scaling and it blew up badly, but I'll take a look at hump and see how it's doing it.

Compost
Prole
Posts: 9
Joined: Mon Oct 08, 2012 6:10 pm

Re: Zoetrope, a starter kit for LOVE

Post by Compost » Wed Oct 10, 2012 12:12 am

I'm not sure if I should post this here or in a new thread, but...

Basically I'm trying to get the player object to be able to create a new object at it's current position.
However, it seems that when you use "velocity" it doesn't update the x and y position of the sprite to follow along.

So I can create the new object, but it get's created at the players original position, not it's current one. Is there a way to "get" the current sprite location? Or just make the x and y positions of the object follow the sprite?

(forgive me if my terminology is incorrect)

User avatar
klembot
Prole
Posts: 30
Joined: Tue Apr 24, 2012 12:41 am

Re: Zoetrope, a starter kit for LOVE

Post by klembot » Wed Oct 10, 2012 3:30 am

Here's a quickie code sample to do what you're looking for.

Code: Select all

the.app = App:extend
{
  onNew = function (self)
    self.block = Fill:new{ x = 0, y = 0, width = 16, height = 16, fill = {255, 255, 255} }
    self.follower = Fill:new
    {
      width = 16, height = 16, fill = {0, 0, 255},
      onUpdate = function (self)
        self.x, self.y = the.app.block.x - 32, the.app.block.y
      end
    }
 
    self:add(self.block)
    self:add(self.follower)
	self.block.velocity.x = 20
  end
}
Basically, the follower syncs its x and y position every frame via onUpdate(). If you're just trying to get a stationary sprite at the current position of a sprite, you should be able to refer to the sprite's x and y properties at the moment you create it. Feel free to post a .love if it's not working for you and I'll take a look.

poke50uk
Prole
Posts: 2
Joined: Tue Oct 09, 2012 7:46 am

Re: Zoetrope, a starter kit for LOVE

Post by poke50uk » Wed Oct 10, 2012 9:15 am

klembot wrote:
poke50uk wrote:Hi klembot,
I'm finding it difficult to see how I can implement a rotation of the camera, for example.. when I press right - I want my Tiled map I create rotates by 90Deg.

I tried just throwing in "hump" on some of your early examples
http://vrld.github.com/hump/#Camera-camera:draw
Someone else asked for a zoom in/out, too... both seem like reasonable requests. I tried something really really basic for scaling and it blew up badly, but I'll take a look at hump and see how it's doing it.
Awesome, thanks ^_^

Compost
Prole
Posts: 9
Joined: Mon Oct 08, 2012 6:10 pm

Re: Zoetrope, a starter kit for LOVE

Post by Compost » Fri Oct 12, 2012 2:05 am

klembot wrote: self.x, self.y = the.app.block.x - 32, the.app.block.y
Ah yes, thank you, that makes sense. Should have been obvious I guess.

I'm attaching a .love* for an unrelated reason; when I use the "focus" function for scrolling, the colors of my background tiles flicker and change. I just ran your "awiderworld" example game, and it seems to do the same thing for the wall tiles...

I have no idea what the cause would be, or if it's fixable.

The player sprite also has annoying jitter while scrolling, but that seems to be related to the "fps" and "velocity", perhaps...

*arrow keys to control the player
Attachments
colorshift.love
(81.24 KiB) Downloaded 166 times

User avatar
klembot
Prole
Posts: 30
Joined: Tue Apr 24, 2012 12:41 am

Re: Zoetrope, a starter kit for LOVE

Post by klembot » Fri Oct 12, 2012 11:25 pm

I *think* what you're seeing is caused by sprites existing at odd coordinates, e.g. (100.01, 100.298), but when drawn onscreen they snap to the nearest pixel. I tried it without snapping before and it led to odd display bugs, like gaps between tiles. I'm not sure if there's a better solution to this one, but I'm open to ideas.

ultrasemen
Prole
Posts: 5
Joined: Sun Aug 12, 2012 9:40 am

Re: Zoetrope, a starter kit for LOVE

Post by ultrasemen » Mon Oct 15, 2012 3:05 am

Hi.
I found bug.
If I press any key in "keyboard/mouse test" in russian language mode, i get "invalid argument" or something like that.
English keys work fine.
I guess it's the same for any non-latin language. Don't know if this is game bug or engine bug. Of course game shouldn't recognise every language on Earth, so maybe just force keyboard language to english?

User avatar
klembot
Prole
Posts: 30
Joined: Tue Apr 24, 2012 12:41 am

Re: Zoetrope, a starter kit for LOVE

Post by klembot » Tue Oct 16, 2012 11:28 pm

ultrasemen wrote:Hi.
I found bug.
If I press any key in "keyboard/mouse test" in russian language mode, i get "invalid argument" or something like that.
This sounds like a Unicode issue. Can you file a bug at https://bitbucket.org/klembot/zoetrope/ ... tatus=open with the exact error message you're getting?

Post Reply

Who is online

Users browsing this forum: No registered users and 32 guests