Hi all.
I have multiple questions.
1) Have anyone played Ortho Robot? (http://www.stabyourselfnet/orthorobot)? There is a music switch. How can I made my music change like it?
2) How to warp player (if he goes off the screen, he'll come back of the opposite side)?
3) How to make a trail like here (non-löve, sorry): http://www.youtube.com/watch?v=mTALu0Mr ... re=related
4) What is that weird OBEY everyone haves?
Thanks again!
Multiple questions
Forum rules
Before you make a thread asking for help, read this.
Before you make a thread asking for help, read this.
Re: Multiple questions
I can't answer all questions, but I try my best:
2) Fizz, had a warpy thingy. Here's the code, but I don't know if it's working right off or if you need the fizz.lua
4) What wreid Obey?
2) Fizz, had a warpy thingy. Here's the code, but I don't know if it's working right off or if you need the fizz.lua
Code: Select all
player.x, player.y = player.x%800, player.y%600
Re: Multiple questions
I can only answer a couple of your questions:
Player warping
To do that, you can set an if statement like so:
Why does everyone have obey? I'm new here too, still don't know why. Hehe.
Player warping
To do that, you can set an if statement like so:
Code: Select all
-- moving RIGHT
if player.x > SCREEN_WIDTH then
player_x = 0
-- MOVING LEFT
if player.x < 0 then
player.x = SCREEN_WIDTH
-- moving UP
if player.y < 0 then
player.y = SCREEN_HEIGHT
-- moving DOWN
if player.y > SCREEN_HEIGHT then
player.y = 0
- Metalcookie
- Prole
- Posts: 16
- Joined: Sat Dec 10, 2011 2:57 pm
- Location: Netherlands
Re: Multiple questions
Hey,
1) Haven't played it, but I see you can download the source code (the .love file) at the bottom of the page you linked.
2) Something like this:
where player.x and player.y are the player's coordinates.
You'll have to fiddle with it a bit so it'll take the image of the player itself into account as well.
3) Particles (http://love2d.org/wiki/ParticleSystem)
4) Magic.
EDIT: 15000th post in Support and Development, I can has cookie now?
1) Haven't played it, but I see you can download the source code (the .love file) at the bottom of the page you linked.
2) Something like this:
Code: Select all
if player.x < 0 then --if he goes off the left edge..
player.x = love.graphics.getWidth() --put him back at the right edge!
elseif player.x > love.graphics.getWidth() then --but if he goes off the right edge..
player.x = 0 --put him back at the left edge!
end
if player.y < 0 then --if he 'falls off' the screen..
player.y = love.graphics.getHeight() --put him back at the top!
elseif player.y > love.graphics.getHeight() then--if he flies off the top of the screen..
player.y = 0 --put him back at the bottom!
end
You'll have to fiddle with it a bit so it'll take the image of the player itself into account as well.
3) Particles (http://love2d.org/wiki/ParticleSystem)
4) Magic.
EDIT: 15000th post in Support and Development, I can has cookie now?
Re: Multiple questions
http://love2d.org/forums/viewtopic.php?f=3&t=9Joliplex wrote: 4) What is that weird OBEY everyone haves?
- Taehl
- Dreaming in associative arrays
- Posts: 1025
- Joined: Mon Jan 11, 2010 5:07 am
- Location: CA, USA
- Contact:
Re: Multiple questions
1) Nope.
2) The fastest way would be to use modulo math on the player's coordinates:3) ParticleSystem
4) What do you mean?
2) The fastest way would be to use modulo math on the player's coordinates:
Code: Select all
love.update(dt)
player.x, player.y = player.x % 800, player.y % 600
end
4) What do you mean?
Earliest Love2D supporter who can't Love anymore. Let me disable pixel shaders if I don't use them, dammit!
Lenovo Thinkpad X60 Tablet, built like a tank. But not fancy enough for Love2D 0.10.0+.
Lenovo Thinkpad X60 Tablet, built like a tank. But not fancy enough for Love2D 0.10.0+.
Who is online
Users browsing this forum: No registered users and 5 guests