Page 1 of 14

Mars Lander. Any collaborators? Noobs welcome.

Posted: Wed Oct 13, 2021 9:05 am
by togFox
I'm starting my next learning curve and thought I'd reach out for collaborators happy to work with github tasks/issues.

I'm thinking old school lunar lander. A retro 2d game that looks a bit like this:

Image

Game play will be beautiful in it's simplicity. Just three keys - rotate left, rotate right and thrust. The traditional game requires you to spawn above the surface and you land gracefully as you fight gravity. I'm thinking something more interesting - you start on the surface and you need to fly above and across the surface to the next "base". You get points and then upgrade your lander. A side-scrolling game I guess.

Here is a concept:

Image

When you land at the next base you get points. Or money. Or fuel. Or something. You can upgrade your lander. That screen might look like this:

Image

Different upgrades do different things of course. Simple physics will be applied (not physics engine). As you add upgrades the mass (weight) of the lander increases which means thrust and handling is reduced etc.

A stretch goal is to make it multiplayer on a LAN so you can race your friend across the surface. Or perhaps save/rescue your friend when he crashes. IDK - perhaps green aliens on the ground and air can make this tricky. Collaborators can help determine which way this goes.

Looking for coders, idea's people, artists. I'm thinking minimalist graphics because I can't do graphics but it can be as awesome as we like. I'm a noob coder so that won't be complex object orientation or classes or anything like that. This means code will be the most unelegant code you've ever seen but perhaps it will make perfect sense to noobs. :) I think I'll provide the most basic of rules (how to declare constants etc) and then let peeps submit their own functions etc. If it works - it's accepted. That simple. If coders enjoy refactoring then that is fine too. I'll no doubt be refactoring as we go.

'Cards' will be created in github so we can track what needs to happen and who is working on what. No commitment necessary. Drop in or drop out as you like.

Will take an iterative approach where we do a base game that functions then we iterate over and improve placeholder graphics then we iterative again and add new features and iterate again and ... etc (basically an 'agile' development approach).

Game will be open source on github and I'll be sharing on itch.io for free. We can keep iterating forever or until we run out of steam. :)

github: https://github.com/togfoxy/MarsLander
https://github.com/togfoxy/MarsLander/projects/1

Re: Mars Lander. Any collaborators? Noobs welcome.

Posted: Wed Oct 13, 2021 10:59 am
by togFox
First cut here and is playable but obviously very very very boring:

Image
MarsLander.love
(14.15 KiB) Downloaded 715 times
Left arrow
Right arrow
Up arrow

Help me apply iterative improvements. :)

Re: Mars Lander. Any collaborators? Noobs welcome.

Posted: Wed Oct 13, 2021 3:04 pm
by milon
Great idea!! Looks like you're going for a widescreen implementation. My max resolution on my work PC is 1280x1024, so it goes off screen on both sides. Here's a way to achieve widescreen on any display size - put this near the top of main.lua, where you assign gintScreenWidth & gintScreenHeight. Aspect ratio is configurable just for fun. :)

Code: Select all

function setWindowSize(aspect)
    aspect = aspect or 16/9
    local modes = love.window.getFullscreenModes()
    local w = 1
    for i = 1, #modes do
        if modes[i].width >= modes[w].width then w = i end
    end
    love.window.setMode(modes[w].width, math.min(modes[w].height, math.floor(modes[w].width / aspect)))
end

setWindowSize()
gintScreenWidth, gintScreenHeight = love.graphics.getDimensions()

EDIT: Consider making the window resizable. Make a file called conf.lua and put this in it. (I may have edited love.load or other things to make this work - I don't recall exactly. See the attached .love)

Code: Select all

function love.conf(t)
    t.window.resizable = true
end
Then instead of using gintScreenWidth & gintScreenHeight everywhere, use love.graphics.getDimensions() instead. Or else, add this to main.lua to update them dynamically:

Code: Select all

function love.resize(w, h)
    gintScreenWidth, gintScreenHeight = w, h
end

EDIT 2: You're drawing dots for the ground. Use lines instead to allow for nice looking (random!) terrain. You've even already defined a garrGround[0] but weren't using it.

Code: Select all

local function DrawSurface()
    for i = 1, gintScreenWidth do
        love.graphics.line(i - 1, garrGround[i - 1], i, garrGround[i])
    end
end
Speaking of random terrain, here's one approach. It would look much better to use noise octaves, but this is a start.

Code: Select all

local function InitialiseGround()
    -- get a random non-integer offset for the noise function
    -- results in coherent noisy terrain, but each game is different
    local offset = love.math.random() * 50000
    local peak = gintScreenHeight / 2
    for i = 0, gintScreenWidth do
        garrGround[i] = love.math.noise(i / gintScreenWidth * 5, offset) * peak + (gintScreenHeight - peak)
    end
end
We'll need to start the lander higher up so it doesn't start underground, lol. :)
In createobjects.lua, change line 10 to Lander.y = 20
It doesn't really matter, but it seems backwards to me to have a lower y value be higher onscreen. Why did you choose that approach?

Re: Mars Lander. Any collaborators? Noobs welcome.

Posted: Wed Oct 13, 2021 9:39 pm
by togFox
Thanks Milon. Glad you tried the very first iteration.

I code for a fixed resolution then rely on the

https://love2d.org/wiki/TLfres

module to manage user resizing and different monitors. The fact you're making those comments suggests to me I haven't activated that module correctly. I will investigate. It is probably why you spawned underground. Works fine for me.

Perhaps you can help with the dots on the ground. As you noticed, I had a line but then moved to an array of dots. Reason: an array of dots lets me adjust the height of the ground literally anywhere whilst also permitting collision detection. If I draw lines then I'm not sure how I would do ground detection at mid points along that line. If I had a list of lines for all the ground segments and used fancy maths for intersects then I'm not sure if that's easier. Perhaps it is. I'm on the bus and not seen your code - maybe you did this already?

I need an algorithm for terrain but again - collision detection.

Hope you and others can help further.

Note to all: I've added some bite-sized cards to github. If you're keen on collaborating then take a look at the cards and see if one is simple enough for you to do and then let us know you'd like to try. :)

https://github.com/togfoxy/MarsLander/projects/1

Some are bugs. Some are design qustions. Some are new features. More cards will be added throughout the project.

Re: Mars Lander. Any collaborators? Noobs welcome.

Posted: Thu Oct 14, 2021 10:43 am
by togFox
Some great progress in just two days with some nudges in the right direction from Milon.

Image

Changes:
- lander has mass and fuel now. Burning fuel reduces mass.
- added a basic algorithm that adds mountains and bumpy terrain. Opted for the retro look instead of Milon's wavey noise (for now)
- drawing points replaced by Milon's drawing by lines. Collision detection retained!
- terrain now side-scrolls as the lander moves left/right.
- screen resizing now works properly

Love file attached.
MarsLander.love
(32.93 KiB) Downloaded 684 times
This is a collaborative project. There are lots of small bite-sized tasks in github. There is coding, audio, graphics and game design all needing some brain cells. :)

Re: Mars Lander. Any collaborators? Noobs welcome.

Posted: Thu Oct 14, 2021 1:33 pm
by milon
togFox wrote: Wed Oct 13, 2021 9:39 pm ... It is probably why you spawned underground. Works fine for me.
That didn't happen until I added in the random terrain. And please don't feel any pressure to use any of my suggestions - this isn't the milon show, lol! :D

Yeah, the .love I uploaded previously has collision testing that works correctly. It didn't need any tweaking to work either. :) (Unless you count the ship not actually crashing, and just getting super stuck for a while. Hold down rotate and accelerate and you'll eventually get out, lol!)

I haven't really used github before :oops: so I'll probably stick to making suggestions here.

EDIT - Just tried the new .love. Very fun! For me, it loads at 800x600 (no widescreen layout). I can make the screen wider, but I just get black bands on either side, like when watching a 4:3 show on a widescreen TV.

Are there new controls? How do you collect fuel?

Re: Mars Lander. Any collaborators? Noobs welcome.

Posted: Thu Oct 14, 2021 2:35 pm
by milon
I added an offscreen indicator so you can see your orientation and have an idea of roughly how far up you are. :)

Re: Mars Lander. Any collaborators? Noobs welcome.

Posted: Thu Oct 14, 2021 5:05 pm
by Gunroar:Cannon()
What type of art is needed. Really retro 8bit or less retro 32-128 :P

Re: Mars Lander. Any collaborators? Noobs welcome.

Posted: Thu Oct 14, 2021 8:41 pm
by togFox
I'm thinking less retro.

Re: Mars Lander. Any collaborators? Noobs welcome.

Posted: Thu Oct 14, 2021 10:30 pm
by Gunroar:Cannon()
Like x32 or x128? Any game you can compare the wanted art style too (not that I'm that good at said game's art style :P )