Search found 89 matches

by Chroteus
Sat Apr 13, 2013 8:11 pm
Forum: Support and Development
Topic: [SOLVED] Make an object follow another object.
Replies: 12
Views: 10748

Re: [SOLVED] Make an object follow another object.

Code: Select all

distance = sqrt(dx*dx+dy*dy)
Oh, I see. We use Pythagoras' Theorem to find out the distance. Thanks a lot. Now it *finally* struck me :nyu:
by Chroteus
Sat Apr 13, 2013 1:39 pm
Forum: Support and Development
Topic: [SOLVED] Make an object follow another object.
Replies: 12
Views: 10748

Re: Make an object follow another object.

Thanks to all of you! I'm starting to get the vectors and trigonometry now. This is the solution I came up with: function fish_move(dt) dx = (player.x - fish.x) * (fish.speed * dt) dy = (player.y - fish.y) * (fish.speed * dt) fish.x = fish.x + (dx * dt) fish.y = fish.y + (dy * dt) end I don't need a...
by Chroteus
Mon Apr 08, 2013 1:51 pm
Forum: Support and Development
Topic: [SOLVED] Make an object follow another object.
Replies: 12
Views: 10748

Re: Make an object follow another object.

Thank you MarekkPie and Daviddoran! Will look into vectors. Thanks for the link!
by Chroteus
Mon Apr 08, 2013 12:43 pm
Forum: Support and Development
Topic: [SOLVED] Make an object follow another object.
Replies: 12
Views: 10748

[SOLVED] Make an object follow another object.

Hello, Löve community! I have a problem I can't (properly) solve. I want enemy to follow player (which is controlled by keyboard). I tried to make this (Just a piece of code): function love.update(dt) if enemy.x > player.x then enemy.x = enemy.x - (player.x * dt * enemy.speed) elseif enemy.y > playe...
by Chroteus
Sun Mar 24, 2013 8:25 pm
Forum: Games and Creations
Topic: The Cubistan - or what a total beginner can do in a week.
Replies: 4
Views: 3494

Re: The Cubistan - or what a total beginner can do in a week

I got to 250 then quit. I had a lot more fun than I expected to. I did think the names of the cubes were a bit cliche. I'd recommend changing them to cube puns, simply because all games are better with puns. Can you be more specific about 'cube puns'? Also, I'm glad that you had fun :) EDIT: I've j...
by Chroteus
Sun Mar 24, 2013 7:56 pm
Forum: Games and Creations
Topic: The Cubistan - or what a total beginner can do in a week.
Replies: 4
Views: 3494

Re: The Cubistan - or what a total beginner can do in a week

That's the point. I wanted red box to move, but couldn't make it not teleport to player itself. So, it's a bit of luck. I made it to 127.
by Chroteus
Sun Mar 24, 2013 7:42 pm
Forum: Games and Creations
Topic: The Cubistan - or what a total beginner can do in a week.
Replies: 4
Views: 3494

The Cubistan - or what a total beginner can do in a week.

First of all let me start this by saying that I haven't had any programming experience before Löve2D and Lua. Yes, 1 week before I didn't even know Löve's basic things. But, in 1 week I could make this game. I hope this serves as a guide to total beginners (like me) which will show them what they ca...
by Chroteus
Sat Mar 23, 2013 9:34 am
Forum: Support and Development
Topic: Do something each n seconds.
Replies: 3
Views: 2215

Re: Do something each n seconds.

Thank you for the snippet ! :)
by Chroteus
Fri Mar 22, 2013 9:56 pm
Forum: Support and Development
Topic: Do something each n seconds.
Replies: 3
Views: 2215

Do something each n seconds.

First of all, hello to all of you. I have just started learning Löve (4 days since I started) and I can say it's a pretty awesome framework. I have already made a simple game. Anyway, I have two questions regarding Löve2D. 1- How can I do something every n seconds? Probably like that: if 5_seconds_p...