Page 12 of 14

Re: The epic love demo thread!

Posted: Sun Nov 16, 2008 4:27 pm
by qubodup
MHD wrote:A little thing I am working on atm...
Fuuuun! :D
a.png
a.png (21.37 KiB) Viewed 5419 times

Re: The epic love demo thread!

Posted: Sun Nov 16, 2008 6:08 pm
by Kaze
MHD wrote:A little thing I am working on atm...
This is fun :P

I made wheels~ :o
Image

Re: The epic love demo thread!

Posted: Mon Nov 17, 2008 4:45 am
by rude
Awesome. Did you implement a convex-polygon algorithm?

Re: The epic love demo thread!

Posted: Mon Nov 17, 2008 7:55 am
by MHD
No, it is still only beta :?

Re: The epic love demo thread!

Posted: Tue Nov 18, 2008 7:35 pm
by qubodup
MHD wrote:No, it is still only beta :?
Hm. It's all fun and fine but then gravity comes and destroys all. ALL.

Re: The epic love demo thread!

Posted: Sun Mar 22, 2009 9:03 am
by qubodup
I prettied Shapes.love a bit using color and sounds. Now it's SuperShapes.love
Image
PS: something to read if you have nothing better to do :)

Life of Land Shark

Posted: Sat Apr 11, 2009 1:10 am
by qubodup
Hello, I'm a land shark! Image

Someone made a land shark life simulator (it's not that exciting really). It's called "Life of Land Shark"

Download LOLS 1.0 here

Or browse the source files here

Re: The epic love demo thread!

Posted: Sat Apr 11, 2009 12:41 pm
by mikembley
om nom nom nom! Image

LÖVE it!

Re: Life of Land Shark

Posted: Sat Apr 11, 2009 2:03 pm
by bartbes
qubodup wrote:(it's not that exciting really)
There isn't even something to eat?

Re: The epic love demo thread!

Posted: Sun Apr 12, 2009 3:23 am
by Xcmd
This is just some code for making a thing go where the mouse clicked. It's not perfect (if you use anything other than 1 to iterate the movement, it gets all wobbly and jiggly and it goes poorly for us all). It also doesn't go DIRECTLY to where the mouse clicked. It actually goes along the shortest axis first, then goes along the rest. So if you've clicked at 50, 60 and the circle is at 0,0, then it's going to go to the X (50), first, then complete the Y (although it'll have gone part of the way towards the Y, until it's on a 0 parity with the X--if that makes any sense).

Anyway, code:

Code: Select all

-- Move to Cursor Love
--
-- How to use: Click on the screen and the ball will move towards the
-- mouse's position.

function load()
	mousePressed = false
	gotoX = 0
	gotoY = 0
	playerBallX = 400
	playerBallY = 300
	speed = 5
end

function update(dt)
	if mousePressed == true then
		if playerBallX ~= gotoX then
			if playerBallX < gotoX then
				playerBallX = playerBallX + 1
			elseif playerBallX > gotoX then
				playerBallX = playerBallX - 1
			end
		end
		if  playerBallY ~=gotoY then
			if playerBallY < gotoY then
				playerBallY = playerBallY + 1
			elseif playerBallY > gotoY then
				playerBallY = playerBallY - 1
			end
		end
	else
		mousePressed = false
	end
end

function draw()
	love.graphics.circle(1, gotoX, gotoY, 5)
	love.graphics.circle(1, playerBallX, playerBallY, 20)
end

function mousereleased(x, y, button)
	if button == love.mouse_left then
		mousePressed = true
		gotoX = x
		gotoY = y
	end
end
Didn't bother .love-ing it because, well... I didn't feel like it. There are better ways to do this, but if you can't figure them out, or if the hiccups in this don't matter then here you go. The mousePressed code isn't really necessary, other than to keep the circle from moving towards 0,0 at the beginning when it's opened.