Game without a title (yet)

Show off your games, demos and other (playable) creations.
Post Reply
User avatar
martincohen
Prole
Posts: 23
Joined: Sat Feb 21, 2015 10:39 am
Contact:

Game without a title (yet)

Post by martincohen »

Hey guys,

this is a first shitty prototype of a game I'm working on:



I've set some challenges in this one. I'm not using love.physics, but instead I'm implementing collisions and "physics" myself (by learning from Handmade Hero series). It's actually my first game in Love2D

I'm quite happy how the shake and explosions feel, even though both of them were just a 5-minute implementation.

Obey! :P
<3
davisdude
Party member
Posts: 1154
Joined: Sun Apr 28, 2013 3:29 am
Location: North Carolina

Re: Game without a title (yet)

Post by davisdude »

Looks good! And thanks for that link! Very interesting stuff... although I think I'll stick with a less "entirely" handmade approach and use LÖVE. :D
GitHub | MLib - Math and shape intersections library | Walt - Animation library | Brady - Camera library with parallax scrolling | Vim-love-docs - Help files and syntax coloring for Vim
Germanunkol
Party member
Posts: 712
Joined: Fri Jun 22, 2012 4:54 pm
Contact:

Re: Game without a title (yet)

Post by Germanunkol »

It doesn't look shitty at all. Looks nice already! I especially like the screen-shake, although it might be too much if it always shakes that much, maybe make it shake less for normal shots and only increase the shake amount when you're close to an explosion or when "heavy" shots are fired?
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
User avatar
martincohen
Prole
Posts: 23
Joined: Sat Feb 21, 2015 10:39 am
Contact:

Re: Game without a title (yet)

Post by martincohen »

@davisdude Thank you! Yeah, I wanted to do that too (originally in Unity), but then I wanted to have more control and less reading manuals or guessing how closed-source stuff works. So I firt implemented the platform layer (in a separate project) to see how it works, then I went for Love2D to use that as my base (as I love Lua). Now I'm doing the "game" stuff in Love2D, just to learn it, before I choose whether to go to bump.lua or love.physics, or even stay with the code I currently have.

@Germanunkol Thank you! Yeah, the shake needs a lot of tuning (at least to not shake that often). Good idea with the distance to explosion! I'll give that a try!
<3
User avatar
nfey
Citizen
Posts: 63
Joined: Tue Feb 18, 2014 9:50 am
Location: Romania

Re: Game without a title (yet)

Post by nfey »

Looks great :). The screen shake does indeed seem over-used, I agree with Germanunkol's advice.

Are you looking at refining the gameplay further or are you just using this to get the basics in place?
User avatar
martincohen
Prole
Posts: 23
Joined: Sat Feb 21, 2015 10:39 am
Contact:

Re: Game without a title (yet)

Post by martincohen »

@nfey: Thanks a lot! <3
nfey wrote:Are you looking at refining the gameplay further or are you just using this to get the basics in place?
I'm just putting "something" together to get the engine-layer working along actually learning how to do things. So I smashed a few basic things I know I'll need together and now I'm "compressing" down to a compact engine lib. I'll refine the details after the base is done. I plan to make this into (at least a tiny one-level) game, just to have something finished and polished as much as I can.

The shake was bugging me for a few days, so I had to give it a try. Now it's done just by

Code: Select all

camera.shake = 8
And it'll shake for a short period of time starting at amplitude of 8 which gradually lowers over a few ms back to 0. So that's all there is for that one. How are you doing it?
<3
User avatar
megalukes
Citizen
Posts: 94
Joined: Fri Jun 27, 2014 11:29 pm
Location: Brazil

Re: Game without a title (yet)

Post by megalukes »

Amazing concept. The shaking camera was really well made. I liked those explosions you made using pentagons, I've been trying to do something like those for a while now :awesome: .

Really looking forward to it. Good luck!
User avatar
martincohen
Prole
Posts: 23
Joined: Sat Feb 21, 2015 10:39 am
Contact:

Re: Game without a title (yet)

Post by martincohen »

@megalukes: Thank you! I'm glad you like it! The explosions are really basic stuff. Here's the code for the entire entity. It's a bit hacky (especially the math.min/max part) but at least you'll get the idea, if you are interested:

Code: Select all

local Timer = require('util.timer')
local C = require('constants')
local Aggregate = require('game.aggregate')
local Entity = require('component.entity')
local Spatial = require('component.spatial')

Explosion = {
    type = C.ENTITY_TYPE_EFFECT,
	ex = {},
	timer = Timer.new()
}

function Explosion:init()
    self.data.flags:unset(C.ENTITY_FLAG_COLLIDABLE)
end

function Explosion:new(x, y)
	self.x = x
	self.y = y
	for i = 1, 8 do
		table.insert(self.ex, {
			x = math.random(-15, 15),
			y = math.random(-15, 15),
			s = 1,
			max_s = math.random(2, 20)
			})
	end

	G.camera.shake = 8
	self.timer:start()
	return self
end

function Explosion:update(dt)
	if self.timer:elapsed() > 1 then
		G.world:removeEntity(self)
		return
	end

	for _, ex in ipairs(self.ex) do
		ex.s = ex.s * math.max(0.9, math.min(1, 50 * dt))
	end
end

function Explosion:drawOne(e)
	LG.setColor(255, 255 * e.s, 255 * e.s)
	LG.circle('fill', self.x + e.x, self.y + e.y, e.s * e.max_s, 7)
end

function Explosion:draw()
	for _, ex in ipairs(self.ex) do
		if ex ~= nil then
			self:drawOne(ex)
		end
	end
end

return Aggregate:declare(
    Entity(),
    Spatial,
    Explosion)
<3
Post Reply

Who is online

Users browsing this forum: No registered users and 76 guests