Early LÖVE code snippets? For learning?

Questions about the LÖVE API, installing LÖVE and other support related questions go here.
Forum rules
Before you make a thread asking for help, read this.
User avatar
heartmonster
Prole
Posts: 8
Joined: Sun Sep 04, 2011 3:26 am
Location: New York, NY

Early LÖVE code snippets? For learning?

Post by heartmonster »

Hi LÖVE people! I'm totally new to LÖVE and Lua... (blah blah blah, usual stuff about experience with other things, but I'm a beginner, etc. etc.). I love video games, and I want to make them, or at least understand a little more about how they're made.

Anyway, usually I don't post to forums but everyone here seems really nice (srsly!), so here goes:

As many have already mentioned, the LÖVE tutorial scene is pretty barren out there on the internets. I've completed some of the tutorials listed on the wiki, and I really enjoyed this other one too: http://www.headchant.com/2010/11/27/lov ... -must-die/. But, having very little programming experience (my areas of expertise are non-programmy languages like CSS & HTML), I'm a little stuck. Where do I go from here?

BUT instead of asking you all for tutorials (which I know is loads of work, and has already been asked many many times), I will ask this:

Can people who know what they're doing with LÖVE (you forum regulars!) please post some of their early code examples? Like if you coded a basic Snake or Space Invaders clone, for example. If you could just throw the code down, that would be amazing, and REALLY REALLY helpful to me and probably other beginners like me.

Thanks so much! Look forward to seeing your stuff. :)
User avatar
TechnoCat
Inner party member
Posts: 1611
Joined: Thu Jul 30, 2009 12:31 am
Location: Milwaukee, WI
Contact:

Re: Early LÖVE code snippets? For learning?

Post by TechnoCat »

This is my first LOVE project: https://bitbucket.org/dannyfritz/megaman/src

It is nice to look at our code, but asking for our first LOVE code is also asking for our worst LOVE code in most cases. Before we figured out how to do things correctly essentially.
User avatar
bartbes
Sex machine
Posts: 4946
Joined: Fri Aug 29, 2008 10:35 am
Location: The Netherlands
Contact:

Re: Early LÖVE code snippets? For learning?

Post by bartbes »

I agree with TechnoCat, and therefore I'll be posting something simple I created later on, npong.
It's a tiny version of pong, ~100 lines, less than a KB in size (zipped).

EDIT: It has come to my attention that it just surpasses 1 KB, I blame rezipping.
Attachments
npong.love
(1.06 KiB) Downloaded 164 times
User avatar
GijsB
Party member
Posts: 380
Joined: Wed Jul 20, 2011 10:19 pm
Location: Netherlands

Re: Early LÖVE code snippets? For learning?

Post by GijsB »

this is my first project, its a puzzle game with buttons :3
Attachments
Puzzle game.love
(2.12 KiB) Downloaded 362 times
User avatar
Robin
The Omniscient
Posts: 6506
Joined: Fri Feb 20, 2009 4:29 pm
Location: The Netherlands
Contact:

Re: Early LÖVE code snippets? For learning?

Post by Robin »

Another eary one, not the first but still definitely rough and unfinished. AFAIK, this was one of the first platformers made in LÖVE. The music and some other bits where added later on, but the original version was made for LÖVE 0.5.0, can you imagine? ;)
Attachments
jump_game_musical.love
(2.91 MiB) Downloaded 146 times
Help us help you: attach a .love.
User avatar
heartmonster
Prole
Posts: 8
Joined: Sun Sep 04, 2011 3:26 am
Location: New York, NY

Re: Early LÖVE code snippets? For learning?

Post by heartmonster »

First of all, thanks!! I have a lot to look through now...
TechnoCat wrote:It is nice to look at our code, but asking for our first LOVE code is also asking for our worst LOVE code in most cases. Before we figured out how to do things correctly essentially.
That may very well be true, but it's better than nothing. Also I'm hoping there will be enough different programs that I'll be able to see differences in ways of doing things, and play around with them. Etc. etc. Anyway, as this is just a hobby, I'm not super concerned either way. ;)
User avatar
Kadoba
Party member
Posts: 399
Joined: Mon Jan 10, 2011 8:25 am
Location: Oklahoma

Re: Early LÖVE code snippets? For learning?

Post by Kadoba »

Here's a little example showing off smooth platform jumping.
Attachments
JumpExample.love
(2.53 KiB) Downloaded 160 times
User avatar
BlackBulletIV
Inner party member
Posts: 1261
Joined: Wed Dec 29, 2010 8:19 pm
Location: Queensland, Australia
Contact:

Re: Early LÖVE code snippets? For learning?

Post by BlackBulletIV »

Well, you can check out the full source for my game Facilitated Escape at its GitHub repo. It's got a quite a lot of stuff in it, like procedural generation, using SpriteBatches to improve rendering performance dramatically, using Quads with tile sheets, saving data to a file, and many other things.

Of course, all that would be quite bewildering for someone in your position; nevertheless I'm sure you can get something out of it.
User avatar
tentus
Inner party member
Posts: 1060
Joined: Sun Oct 31, 2010 7:56 pm
Location: Appalachia
Contact:

Re: Early LÖVE code snippets? For learning?

Post by tentus »

This wasn't my first project, but it may be informative: 8 Dimensions Rendered. I do some fairly simple rendering stuff and some table manipulation, which is where you'll spend a lot of your development time if you code anything like I do.
Kurosuke needs beta testers
User avatar
heartmonster
Prole
Posts: 8
Joined: Sun Sep 04, 2011 3:26 am
Location: New York, NY

Re: Early LÖVE code snippets? For learning?

Post by heartmonster »

Aaah! Thank you guys so much! This is more helpful than you can imagine. So much of the code out there is like 100 steps above what I can comprehend at this level.

Anyway, I made something. This is my first ever programmed thing I've ever made so it's very simple. But I'm happy with it. :D
Attachments
boxstory.love
(1.14 KiB) Downloaded 141 times
Post Reply

Who is online

Users browsing this forum: Bing [Bot], Google [Bot] and 7 guests