Multiple questions

Questions about the LÖVE API, installing LÖVE and other support related questions go here.
Forum rules
Before you make a thread asking for help, read this.
Post Reply
Joliplex
Prole
Posts: 7
Joined: Wed Dec 07, 2011 12:17 pm

Multiple questions

Post by Joliplex »

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!
User avatar
Jack5500
Party member
Posts: 149
Joined: Wed Dec 07, 2011 8:38 pm
Location: Hamburg, Germany

Re: Multiple questions

Post by Jack5500 »

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

Code: Select all

player.x, player.y = player.x%800, player.y%600
4) What wreid Obey?
User avatar
runyonave
Prole
Posts: 27
Joined: Tue Dec 06, 2011 2:06 am

Re: Multiple questions

Post by runyonave »

I can only answer a couple of your questions:

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
Why does everyone have obey? I'm new here too, still don't know why. Hehe.
User avatar
Metalcookie
Prole
Posts: 16
Joined: Sat Dec 10, 2011 2:57 pm
Location: Netherlands

Re: Multiple questions

Post by Metalcookie »

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:

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
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?
coffee
Party member
Posts: 1206
Joined: Wed Nov 02, 2011 9:07 pm

Re: Multiple questions

Post by coffee »

Joliplex wrote: 4) What is that weird OBEY everyone haves?
http://love2d.org/forums/viewtopic.php?f=3&t=9
User avatar
Taehl
Dreaming in associative arrays
Posts: 1025
Joined: Mon Jan 11, 2010 5:07 am
Location: CA, USA
Contact:

Re: Multiple questions

Post by Taehl »

1) Nope.
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
3) ParticleSystem
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+.
Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot] and 201 guests