Spaceship building

Show off your games, demos and other (playable) creations.
Post Reply
gavor
Prole
Posts: 3
Joined: Sat Jul 28, 2012 6:32 am

Spaceship building

Post by gavor » Sat Jul 28, 2012 6:40 am

Hi,

This is my first Lua app of any kind so please keep this in mind if you take a look over the code.

The object is simply to build a spaceship. You drag components out of the menu and stick them together. That's all at the moment, though I intend to expand on it. There's a larger game in mind which will be done in C++ or similar, I just decided to use Love for prototyping because it looked so simple to throw something together.

Any comments welcomed and encouraged.

Cheers.
Attachments
SC_0.03a.love
Latest version - 29 July 2012
(42.69 KiB) Downloaded 168 times
Last edited by gavor on Mon Jul 30, 2012 12:22 am, edited 1 time in total.

Germanunkol
Party member
Posts: 710
Joined: Fri Jun 22, 2012 4:54 pm
Contact:

Re: Spaceship building

Post by Germanunkol » Sat Jul 28, 2012 11:38 am

I like the idea of building your own spaceship.
What doesn't work well yet: if you pick up a piece, it always jumps. To avoid this, instead of having a predefined relative distance between mouse pointer and moved object, you should get the distance upon clicking, store that, and move the picture with this.

Also, you should create way more tiles. Right now, I have a hard time building a spaceship from the parts you supply.

A fun (but not necessary) idea would be to automatically detect all images that are in the Images folder and, if they have a certain predefined length and width, make them automatically load as spaceship parts. This way, anyone could create and use new spaceship parts easily, without having to modify code. Just a thought though.
trAInsported - Write AI to control your trains
Bandana (Dev blog) - Platformer featuring an awesome little ninja by Micha and me
GridCars - Our jam entry for LD31
Germanunkol.de

gavor
Prole
Posts: 3
Joined: Sat Jul 28, 2012 6:32 am

Re: Spaceship building

Post by gavor » Sat Jul 28, 2012 11:13 pm

Thanks for the feedback.

I also hate it when the component jumps, it's been on the radar to fix that but I hadn't got there yet. This morning I had a major breakthrough with how snapping works, so now I can move onto other things :).

I'll try to fix that up today. As for more components, they're on the way - I just need to test the system with images that are not 64x64 first and see if it handles them properly.

As for reading them from the images folder, it's a good idea but not the direction I'm heading. The components will eventually have stats so as you build a ship it alters the overall ship stats and displays things like speed, armour, DPS and so on. This way you can try to build balanced ships or dreadnoughts or...well..whatever you like. The components and their stats will eventually be stored in an xml file (or similar) and read into the app at run time. I don't really want those altered by the player, but I haven't got that far and I'll cross that bridge when I get there.

Thanks again for the input, I'll post an updated version either tonight or tomorrow.

stripwax
Prole
Posts: 39
Joined: Sun Jul 31, 2011 1:16 pm

Re: Spaceship building

Post by stripwax » Sun Jul 29, 2012 4:18 pm

Something peculiar seems to be happening with the z-order: once you've placed a piece, if you pick it up again and move it around, it sometimes moves 'in front' of other pieces, and sometimes moves 'behind' them. I haven't looked at your .lua code but you can probably get around this by making sure the grabbed piece gets moved to the end of your draw loop / end of your spritebatch / etc.

Also, not sure how well this works on my netbook, think it needs a bigger screen size to work properly?

gavor
Prole
Posts: 3
Joined: Sat Jul 28, 2012 6:32 am

Re: Spaceship building

Post by gavor » Mon Jul 30, 2012 12:25 am

Just refreshed the download with the latest version. The snapping and dragging are greatly improved now and you can select objects by clicking or multi-select with CTRL.

Delete key deletes selected objects.

f - go to fullscreen

I've also thought a bit about the z-order but decided it's a low priority for the moment. I'll address that later. As I understand it there is no z-order handling in Love yet but if I re-sort the table of objects the one at the top (first item in the table) will be at the top of the z-order (in front of everything else).

Post Reply

Who is online

Users browsing this forum: No registered users and 5 guests