topbanner_forum
  *

avatar image

Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
  • Tuesday March 19, 2024, 2:52 am
  • Proudly celebrating 15+ years online.
  • Donate now to become a lifetime supporting member of the site and get a non-expiring license key for all of our programs.
  • donate

Author Topic: SHMUP, A Löve2D story  (Read 30918 times)

p3lb0x

  • Supporting Member
  • Joined in 2007
  • **
  • Posts: 424
  • Beer, beer, beer, I'm going for a beer!
    • View Profile
    • Donate to Member
SHMUP, A Löve2D story
« on: September 22, 2013, 08:35 PM »
So, in order to get my game on for NANY2014 I decided to get cracking and learn some programming. To do this, I decided to make a game using Löve2D. Löve2D is a framework that allows you to build 2d games fairly quickly using Lua. Since Lua pretty much is the only language I've had a bit of experience with it seemed like a good place to start.

Anyhow, the purpose of this thread is to chronicle the progress on this training project. Since I haven't really saved any versions yet (I plan to when I've hit some milestone, like getting the basics down) I will start from my current build and work my way forward with each new post, explaining what I've done and possibly what went wrong. With this I can look back at what I made and hopefully learn more than I did while doing it. Anyhow, lets get on with it.

These first few videos are from the early stages when I wasn't really doing much but trying to set up the basic framework to build my game on.





This video showcases projectiles and an enemy. Both were terribly done as I had mocked about in a stupid way with all the rotation and positions of the entities, this was later fixed. Even though the effect is minimal, it's always nice to do things the right way.





Gave the projectiles sprites and added different effects to the game. Including the randomly placed twinkling stars in the background.





This is where the fun begins, I changed the actual firing of projectiles from being hardcoded into the playership into objects that can be attached in arbitrary number to the ship. This way I can have powerups and upgrades without going through too many hoops. I also added some damage indication to the enemy ships as well as more stats to calculate damage. In the second video I got sound working and added some temporary sounds to the game, I don't own the rights to the music though and I plan to change it to something I can legally use later, so far it serves as a placeholder however.




In case you want to try it out, the latest compiled version can be found here. I have no idea what is needed to run it, but from what I gather it runs best under either windows 7 or 8.

Controls are the arrow keys for movement, space for shooting and p for pause

Updates:
Update1
Update2
Stop mousering people so much - Mouser
« Last Edit: September 25, 2013, 03:41 PM by p3lb0x »

Deozaan

  • Charter Member
  • Joined in 2006
  • ***
  • Points: 1
  • Posts: 9,746
    • View Profile
    • Read more about this member.
    • Donate to Member
Re: SHMUP, A Löve2D project
« Reply #1 on: September 22, 2013, 09:13 PM »
That's looking pretty sweet, p3l! Keep it up. :-)

mouser

  • First Author
  • Administrator
  • Joined in 2005
  • *****
  • Posts: 40,896
    • View Profile
    • Mouser's Software Zone on DonationCoder.com
    • Read more about this member.
    • Donate to Member
Re: SHMUP, A Löve2D project
« Reply #2 on: September 22, 2013, 09:41 PM »
Nice work p3lb0x -- it's great to be able to read about and see member project progress reports  :up:

p3lb0x

  • Supporting Member
  • Joined in 2007
  • **
  • Posts: 424
  • Beer, beer, beer, I'm going for a beer!
    • View Profile
    • Donate to Member
Re: SHMUP, A Löve2D story
« Reply #3 on: September 24, 2013, 07:15 PM »


Added sprites to the guns, some nonplaceholder stuff to the options menu as well as a clunky level system.

The enemies all need to be placed by a level author, but with levels being objects by themselves, you could have randomly placed enemies as well if you so desire, I've also added functions for placing formations of enemies and it would be possible to use these functions to "paint" a level or something further down the line.

edit: Bonus video showing off hitboxes.
Stop mousering people so much - Mouser
« Last Edit: September 24, 2013, 10:11 PM by p3lb0x »

mouser

  • First Author
  • Administrator
  • Joined in 2005
  • *****
  • Posts: 40,896
    • View Profile
    • Mouser's Software Zone on DonationCoder.com
    • Read more about this member.
    • Donate to Member
Re: SHMUP, A Löve2D story
« Reply #4 on: September 24, 2013, 07:33 PM »
Watching your latest video gave me a strange idea, i'm not sure if it's been done before or how practical it is...

What if you could find a way to interpret a music sound file as the enemy ship level..

So think of it this way -- think about processing the music file with a visual waveform, and then using the waveform to somehow control the movement and behaviors of enemies..

It would be fun to think about being able to load up any song -- and "play" that level.


p3lb0x

  • Supporting Member
  • Joined in 2007
  • **
  • Posts: 424
  • Beer, beer, beer, I'm going for a beer!
    • View Profile
    • Donate to Member
Re: SHMUP, A Löve2D story
« Reply #5 on: September 24, 2013, 07:51 PM »
Games like Audiosurf and Beat Hazard do this, so it is definitely possible. Whether or not I have the skills to make it happen is another thing all together. At the moment I am still trying to get the basic systems down for the game to work off.

edit:



Pretty much done adding the basics of the customization system between levels. Also thought a bit about advanced gameplay. At the moment players are awarded additional statpoints to level up if they save score or money between levels. The score they keep between levels is also added to the total score pool, which would give a better highscore at the end of the game. I've also added a fire velocity upgrade after this video. It should also be noted that the first short thing it goes to after starting a new game is a debug level that awards a large amount of score. I also uploaded a new version if anyone wants to test it out, download link is in the opening post.

edit: Fixed annoying small bug with Swivel Machine Guns

edit edit: Fixed bug with hitboxes being active before they were meant to

Also, PEW PEWS

Stop mousering people so much - Mouser
« Last Edit: September 25, 2013, 10:36 PM by p3lb0x »

Deozaan

  • Charter Member
  • Joined in 2006
  • ***
  • Points: 1
  • Posts: 9,746
    • View Profile
    • Read more about this member.
    • Donate to Member
Re: SHMUP, A Löve2D story
« Reply #6 on: September 26, 2013, 03:57 PM »
That's looking great! Nice work!

tomos

  • Charter Member
  • Joined in 2006
  • ***
  • Posts: 11,958
    • View Profile
    • Donate to Member
Re: SHMUP, A Löve2D story
« Reply #7 on: September 26, 2013, 05:02 PM »
That's looking great! Nice work!

+1 looks really good
Tom

p3lb0x

  • Supporting Member
  • Joined in 2007
  • **
  • Posts: 424
  • Beer, beer, beer, I'm going for a beer!
    • View Profile
    • Donate to Member
Re: SHMUP, A Löve2D story
« Reply #8 on: September 30, 2013, 09:57 AM »


After a short hiatus I am once again back with an update.

Levels now take advantage of object oriented programming features, customization screen updated with keyboard controls and the ability to sell weapons and mirror them on the ship.
I've also fixed the weird flipping when adding stuff to the ship in customization after creating the video.

edit: also just added the ability to change starting direction for swiveling guns

edit edit: Added a bit more to the level



edit edit edit: Added rockets and other minor tweaks, starting to experience some slow down. From what I've gathered by asking Löve2D enthusiasts, I should be able to speed it up immensely by changing the way I draw my sprites. I also need to fix some math in the rockets.

Stop mousering people so much - Mouser
« Last Edit: September 30, 2013, 09:12 PM by p3lb0x »

Deozaan

  • Charter Member
  • Joined in 2006
  • ***
  • Points: 1
  • Posts: 9,746
    • View Profile
    • Read more about this member.
    • Donate to Member
Re: SHMUP, A Löve2D story
« Reply #9 on: October 01, 2013, 05:42 PM »
I downloaded it and gave it a try. It works just fine on my computer. Windows 7 x64. Pretty cool!

p3lb0x

  • Supporting Member
  • Joined in 2007
  • **
  • Posts: 424
  • Beer, beer, beer, I'm going for a beer!
    • View Profile
    • Donate to Member
Re: SHMUP, A Löve2D story
« Reply #10 on: October 08, 2013, 08:28 PM »
This might kind of suck, but I have decided to stop working on this here project. The game bugged down at the point I am at now and it would render the game unplayable in the long run. I have tried to fix some of the stuff and come to the conclusion that it would be a waste of time trying to fix things. Some of the optimizations I should have done in SHMUP needed to be done earlier and with more forethought to be effective which is why I decided that it wasn't worth it. The entire ordeal hasn't been a waste though, as I've learned a lot about Löve2D and general programming things. With this knowledge I should be able to complete my NANY project not just faster but also more cleanly and bug free.

Things I've learned:

  • Basic idea and execution of object oriented programming
  • How to hopefully keep things manageable by breaking tasks up into chunks
  • That I need a game plan at the beginning rather than doing stuff that feels fun


Short list of things I need to remember:

  • Don't calculate stuff constantly that could be calculated once and saved
  • Don't use expensive math functions if possible, even if they are more convenient
  • Make use of functions for drawing that speeds up the process (Quads, spritebatches, and canvas's)
  • Try to plan out the general framework ahead of time instead of doing it as you go along (Don't go overboard though)
  • Try to minimize feature creep, do one thing at a time and then move on to the next.


With that said, I am open for ideas relating to what kind of game I could finish for a NANY as I am not very imaginative.

edit: Also found out that there are löve2d builds made with LuaJIT which apparently speeds up math calculations a lot
Stop mousering people so much - Mouser
« Last Edit: October 08, 2013, 10:20 PM by p3lb0x »

Ath

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 3,610
    • View Profile
    • Donate to Member
Re: SHMUP, A Löve2D story
« Reply #11 on: October 09, 2013, 01:31 AM »
This might kind of suck, but I have decided to stop working on this here project. The game ...
and
Things I've learned:
this
Short list of things I need to remember:
and this
Also found out that...

Isn't that what a perfect PoC should be? You started a project with the object of learning something new, you did, you made a few mistakes/errors/bad decisions/n00b faults, then to throw it all away and use the knowledge gained for a real project. Kudo's :Thmbsup:

Deozaan

  • Charter Member
  • Joined in 2006
  • ***
  • Points: 1
  • Posts: 9,746
    • View Profile
    • Read more about this member.
    • Donate to Member
Re: SHMUP, A Löve2D story
« Reply #12 on: October 09, 2013, 02:37 AM »
Keep us posted on what you make next. It was enjoyable to follow your progress on this project. :Thmbsup:

mouser

  • First Author
  • Administrator
  • Joined in 2005
  • *****
  • Posts: 40,896
    • View Profile
    • Mouser's Software Zone on DonationCoder.com
    • Read more about this member.
    • Donate to Member
Re: SHMUP, A Löve2D story
« Reply #13 on: October 09, 2013, 02:39 AM »
Just want to echo what Ath and Deozaan said  :up: