Give me a simple challenge

General discussion about LÖVE, Lua, game development, puns, and unicorns.
Post Reply
badfitz66
Prole
Posts: 30
Joined: Sat Jun 07, 2014 10:30 pm

Give me a simple challenge

Post by badfitz66 »

Brand new to love2d, can someone give me a simple challenge for a beginner?
User avatar
MadByte
Party member
Posts: 533
Joined: Fri May 03, 2013 6:42 pm
Location: Braunschweig, Germany

Re: Give me a simple challenge

Post by MadByte »

Create a simple "Avoid" Game with a basic mainmenu, pause function, gameplay and game over screen.
Avoid game means for me you control something and have to avoid other objects. After some sort of condition ( passed objects or time) increase the difficulty by making the objects faster ; spawn more of them ; make them bigger etc.

To difficult ? I believe you can do this ! :cool:
badfitz66
Prole
Posts: 30
Joined: Sat Jun 07, 2014 10:30 pm

Re: Give me a simple challenge

Post by badfitz66 »

i can't even create a simple 2D physics sandbox without using the wiki
User avatar
Jeeper
Party member
Posts: 611
Joined: Tue Mar 12, 2013 7:11 pm
Contact:

Re: Give me a simple challenge

Post by Jeeper »

Who said you can't use the wiki? I use the wiki all the time :)

You will never learn anything if you do not attempt something that you do not know how to do.
User avatar
kikito
Inner party member
Posts: 3153
Joined: Sat Oct 03, 2009 5:22 pm
Location: Madrid, Spain
Contact:

Re: Give me a simple challenge

Post by kikito »

  • Level 1: Make a ship move around in the screen with the arrow keys (the ship always looks to the right). Make the ship more or less rectangular.
  • Level 2: Make a single bad guy (looking to the left) which spaws at a random position just outside of the screen on the right, and then moves to the left. He doesn't interact with the ship at all. Once he reaches the left, he dissapears, and he doesn't appear again. The bad guy should be more or less rectangular too.
  • Level 3: Spawn a new bad guy once every 5-10 seconds, randomly (Hint: you will need to insert them into a table when they are created and remove them when they reach the left side). Bad guys should move to the left with different speeds (chosen randomly too).
  • Level 4: Make the ship shoot bullets to the right, once every time you press space (make sure you are not able to spawn infinite bullets by keeping spacebar pressed). Hint: Use a table for the bullets, too.
  • Level 5: Detect when a bullet hits a bad guy, and remove both. You can use [wiki]BoundingBox.lua[/wiki] to test for this (you did your enemies rectangular, right?). And you will need a loop inside a loop.
  • Level 6: Make the player die when an enemy touches him.
That's all you need to make a very simple, but manageable, game. You can expand more if you want.

Don't forget to ask around if you get stuck :)
When I write def I mean function.
User avatar
MadByte
Party member
Posts: 533
Joined: Fri May 03, 2013 6:42 pm
Location: Braunschweig, Germany

Re: Give me a simple challenge

Post by MadByte »

What kikito said.
badfitz66 wrote:i can't even create a simple 2D physics sandbox without using the wiki
I can't either. I almost never use the physics module, but if I do I look how I could do what I am heading for.
But for my sugguestion the physics module isn't required.

You can start with the player. Create a rectangle which can be moved via the arrow keys. then, find a way to create multiply other objects. If you cant manage it, look in the forums, there are many topics about it.

then look for collisions, use a simple bounding box collision, example:

Code: Select all

function boxCollision(ax, ay, aw, ah, bx, by, bw, bh)
  return ax + aw < bx and ax > bx + bw and
  ay + ah < by and ay > by + bh
end
And so on... Just do it step by step. Then this is super easy. :)
User avatar
Zilarrezko
Party member
Posts: 345
Joined: Mon Dec 10, 2012 5:50 am
Location: Oregon

Re: Give me a simple challenge

Post by Zilarrezko »

What kikito said...

But...

You must do every loop... WIIIIIIIIIIIIIIIITH............................. REPEAT LOOPS!

[Monty Python anyone?]
User avatar
nice
Party member
Posts: 191
Joined: Sun Sep 15, 2013 12:17 am
Location: Sweden

Re: Give me a simple challenge

Post by nice »

badfitz66 wrote:Brand new to love2d, can someone give me a simple challenge for a beginner?
I'm not that familiar with Löve (or programming for that matter) but when you're start to get the hang with Löve, a suggestion could be that you take a old popular game (like Tetris for example) and recreate it and add your twist to it but not too much but just enough so that you change what's normally associated with that game.

I also suggest that you take your ideas and sketch it down onto a sketchbook (or you can document it digitally, it's a matter of preference), just so you have that for next time you want to make something.

[EDIT]
Using the Löve2D wiki is nothing to be ashamed of, I'm pretty sure that (correct me if I'm wrong) it's safe to say that everyone uses the wiki because if it didn't exist when I wouldn't have gotten into programming at all.
:awesome: Have a good day! :ultraglee:
User avatar
Plu
Inner party member
Posts: 722
Joined: Fri Mar 15, 2013 9:36 pm

Re: Give me a simple challenge

Post by Plu »

Using the Löve2D wiki is nothing to be ashamed of, I'm pretty sure that (correct me if I'm wrong) it's safe to say that everyone uses the wiki because if it didn't exist when I wouldn't have gotten into programming at all.
I do programming for a living, and StackOverflow and the documentation for the framework/language I work with are practically my homepages. You should never be ashamed of having to look stuff up; that's what wikis are for. :)
Post Reply

Who is online

Users browsing this forum: No registered users and 7 guests