It seems I can't put an attachment on a PM so here is a .love with the working shader, use WASD to move the stars.
If you unzip it and check the main.lua you can see how to get it working in your program, playing with the variables will get a more custom movement style. Hope this helps.
still noob and going to learn :)
-
- Party member
- Posts: 107
- Joined: Wed Oct 15, 2014 5:00 pm
- Location: Yorkshire, England
Re: still noob and going to learn :)
Code: Select all
if not wearTheseGlasses() then
chewing_on_trashcan = true
end
Re: still noob and going to learn :)
hello pedrogal
thanx a lot i go test and read it in the minutes coming.
i started to take informations in the sheepolution website and saw how it is simple to move a rectangle with a little code i have to test it tomorrow or before
thanx a lot i go test it right now
regards
thanx a lot i go test and read it in the minutes coming.
i started to take informations in the sheepolution website and saw how it is simple to move a rectangle with a little code i have to test it tomorrow or before
thanx a lot i go test it right now
regards
Re: still noob and going to learn :)
ok i saw it and apart the stars (perhaps it is a bitmap "texture" done with plenty of random points ?) i can understand the way you done it. si move the stars with the command in love to move by keyboard. ok could you please give me the source ? i go tomorrow test the rectangle to move by keyboard and then we'll see i have to learn smoothly
thanx a lot yet
regards
thanx a lot yet
regards
-
- Party member
- Posts: 107
- Joined: Wed Oct 15, 2014 5:00 pm
- Location: Yorkshire, England
Re: still noob and going to learn :)
All the code is in the .love, unzip it and take a look.
Code: Select all
if not wearTheseGlasses() then
chewing_on_trashcan = true
end
Re: still noob and going to learn :)
hello my dear new friend
i begin to mistake but i' m a noob
here some bad script done, and no result
ok i go see ! thanx a lot
i begin to mistake but i' m a noob
here some bad script done, and no result
Code: Select all
function love.load()
end
function love.update(dt)
x = x + 5 * dt
end
function love.draw()
end
function love.load()
x = 100
end
function love.draw()
love.graphics.rectangle("line", x, 50, 200, 150)
end
love.draw()
Re: still noob and going to learn :)
To start, you have declared love.load and love.draw twice each. Also, you called love.draw manually at the end of the file, which just calls the function once when the file first initializes. Here's a quick example:
Code: Select all
function love.load()
-- Create a "player" table
player = {
x = 300,
y = 300,
w = 50,
h = 100,
speed = 100
}
end
local keyDown = love.keyboard.isDown
function love.update(dt)
-- Left <> Right
if keyDown('a') then
player.x = player.x - player.speed * dt
elseif keyDown('d') then
player.x = player.x + player.speed * dt
end
-- Up <> Down
if keyDown('w') then
player.y = player.y - player.speed * dt
elseif keyDown('s') then
player.y = player.y + player.speed * dt
end
end
function love.draw()
love.graphics.rectangle('fill', player.x, player.y, player.w, player.h)
end
Re: still noob and going to learn :)
hello beeltz and thanx a lot
i go learn this afternoon thanx for source
regards
i go learn this afternoon thanx for source
regards
Re: still noob and going to learn :)
ys it works fine ! so with the starfield i will give a vertical way, the rectangle i can change for a sprite i think i will have the way to do a cool intro ! i go learn more and show you in date and time "my" compilation of this
thanx a lot
thanx a lot
Re: still noob and going to learn :)
hello all
me back again
so if i understand, no need to call the fonction() at the end of the scrip ? only make a love.draw() with a cool with the other functions ?
tell me what i go see how to work with tomorrow
regards to all, this forum is great and i'm happy to meet you and/with your cool sympaty
stéphane
me back again
so if i understand, no need to call the fonction() at the end of the scrip ? only make a love.draw() with a cool with the other functions ?
tell me what i go see how to work with tomorrow
regards to all, this forum is great and i'm happy to meet you and/with your cool sympaty
stéphane
Re: still noob and going to learn :)
The game loop works(usually behind the scenes) using love.run. This is generally how it works:
There are also other callbacks to handle keyboard, mouse, etc, all in the wiki. I'm telling you, that wiki will be your best friend. Take your time reading it, it's very well documented!
Code: Select all
-- Read and run whatever isn't in a function top to bottom
local a = 1
-- Including if you invoke a function(note that the function is called after it is declared)
function hello()
print('Hello!')
end
hello()
-- Then run love.load
function love.load()
end
-- Then loop back and forth between love.update and love.draw (the loop)
function love.update(dt)
end
function love.draw()
end
Who is online
Users browsing this forum: Ahrefs [Bot] and 4 guests