Page 4 of 5

Re: REQUESTING HELP - Posting Rules

Posted: Sun Sep 08, 2013 2:13 pm
by Punkroku
++Karma is that a joke??? or is there a way to do that...

PS> I was offended by microshafts's paperclip... this must be as useful as tweezers when you need to go to the bathroom.

I am a firm believer that Microsoft Windows should be renamed tinyFlaccid Backdoors... It is apparent that it fails penetration testing...

Re: REQUESTING HELP - Posting Rules

Posted: Thu Feb 20, 2014 8:06 am
by Gavolot
I like your Love2D engine very much. I'm even making the project on it. I think that I will done it soon. But I doesn't like your file system. Of course, such desision like "\AppData\oaming\Love" can be enouth for games. However, this system is not good for programms, or even for small level editors at all(Yeah, I understand that I can solve that somehow), but this is too uncomfortably. Sorry for mistakes, but I still learning english.

Re: REQUESTING HELP - Posting Rules

Posted: Sun Feb 22, 2015 6:13 pm
by thechubbymonkey
Great rules! This will keep the forums nice and clean. :awesome: :awesome: :awesome:

Re: REQUESTING HELP - Posting Rules

Posted: Fri Jun 19, 2020 6:55 am
by rick
I approve this message

Re: REQUESTING HELP - Posting Rules

Posted: Mon Feb 08, 2021 12:19 pm
by Raaidah
Hi. I'm new to love 2d, however my app just keeps showing no games. Is there anyone that can guide me through. Please

Re: REQUESTING HELP - Posting Rules

Posted: Sun Apr 04, 2021 11:34 pm
by Gunroar:Cannon()
Raaidah wrote: Mon Feb 08, 2021 12:19 pm Hi. I'm new to love 2d, however my app just keeps showing no games. Is there anyone that can guide me through. Please
You still here? I just noticed this like now :ultrahappy: .
You asked for help with a no game screen. If it's on android then the main.lua file isn't in directory lovegame. You didn't get help immediately because you posted it here. Should have made a topic then asked. :P.

Re: REQUESTING HELP - Posting Rules

Posted: Tue Apr 13, 2021 1:10 pm
by milon
Raaidah wrote: Mon Feb 08, 2021 12:19 pm Hi. I'm new to love 2d, however my app just keeps showing no games. Is there anyone that can guide me through. Please
Love2D isn't a game itself. It's framework for games. You still have to supply the .love game file. Once you have that, don't run Love2D itself - run the .love instead.

Re: REQUESTING HELP - Posting Rules

Posted: Sat Jun 11, 2022 12:26 am
by onil_cupp13
:awesome: :awesome: :awesome: :awesome: :awesome: :awesome: :awesome: :awesome: :awesome: :awesome:

Re: REQUESTING HELP - Posting Rules

Posted: Sun Jul 10, 2022 8:39 am
by Gunroar:Cannon()
onil_cupp13 wrote: Sat Jun 11, 2022 12:26 am :awesome: :awesome: :awesome: :awesome: :awesome: :awesome: :awesome: :awesome: :awesome: :awesome:
So happy they could poop themselves

Re: REQUESTING HELP - Posting Rules

Posted: Fri Apr 21, 2023 2:56 am
by Franator
I am just learning to use Love2D. I’m trying to figure out how to make my player fire bullets and take the enemies. Could someone please advise me?

My main.lua code so far is below:
push = require 'push'

WINDOW_WIDTH = 600
WINDOW_HEIGHT = 500

VIRTUAL_WIDTH = 485
VIRTUAL_HEIGHT = 404

local backgroundScroll = 0
local midgroundScroll = 0
local groundScroll = 0

local enemyFrames = {}
local enemyframeWidth = 40
local frameHeight = 72
local totalNumberofFrames = 4
local currentFrame = 1
local desiredDelayBetweenFrameChanges = 0.3
local timePassedSinceLastFrameChange = 0

local playerFrames = {}
local playerframeWidth = 40
local frameHeight = 72
local totalNumberofFrames = 4
local currentFrame = 1
local desiredDelayBetweenFrameChanges = 0.3
local timePassedSinceLastFrameChange = 0

local enemy1Frames = {}
local enemy1frameWidth = 43
local frameHeight = 72
local totalNumberofFrames = 4
local currentFrame = 1
local desiredDelayBetweenFrameChanges = 0.3
local timePassedSinceLastFrameChange = 0

local enemy2Frames = {}
local enemy2frameWidth = 41.6
local frameHeight = 72
local totalNumberofFrames = 4
local currentFrame = 1
local desiredDelayBetweenFrameChanges = 0.3
local timePassedSinceLastFrameChange = 0

local BACKGROUND_SCROLL_SPEED = 5
local MIDGROUND_SCROLL_SPEED = 30
local GROUND_SCROLL_SPEED = 45

local MIDGROUND_LOOPING_POINT = 710
local BACKGROUND_LOOPING_POINT = 700

function love.load()
love.window.setTitle('Zombie Attack')
love.graphics.setDefaultFilter('nearest', 'nearest')
midground = love.graphics.newImage("sprites/midground.png")
background = love.graphics.newImage("sprites/background.png")
ground = love.graphics.newImage("sprites/ground.png")

sounds = {}
sounds.bg = love.audio.newSource("sounds/background.mp3", "stream")
sounds.reload = love.audio.newSource("sounds/reload.mp3", "static")
sounds.shooting = love.audio.newSource("sounds/shooting.mp3",
"static"
)
sounds.zombies = love.audio.newSource("sounds/zombiesound.mp3",
"static"
)

sounds.bg:play()
sounds.zombies:setLooping(true)
sounds.zombies:play()

logo = love.graphics.newImage("sprites/ZAlogo.png")

player = {}
player = love.graphics.newImage("sprites/player.png")
playerx = 40
playery = 300

shots = {}
shots = love.graphics.newImage("sprites/shots.png")

enemy = {}
enemy = love.graphics.newImage("sprites/Zombie1.png")
enemyx = 430
enemyy = 300

enemy1 = {}
enemy1 = love.graphics.newImage("sprites/Zombie2.png")
enemy1x = 430
enemy1y = 310

enemy2 = {}
enemy2 = love.graphics.newImage("sprites/Zombie3.png")
enemy2x = 430
enemy2y = 294


for frame = 1, totalNumberofFrames do
enemyFrames[frame] = love.graphics.newQuad((frame - 1) * enemyframeWidth, 0, enemyframeWidth, frameHeight,
enemy:getDimensions())
end

for frame = 1, totalNumberofFrames do
enemy1Frames[frame] = love.graphics.newQuad((frame - 1) * enemy1frameWidth, 0, enemy1frameWidth, frameHeight,
enemy1:getDimensions())
end

for frame = 1, totalNumberofFrames do
enemy2Frames[frame] = love.graphics.newQuad((frame - 1) * enemy2frameWidth, 0, enemy2frameWidth, frameHeight,
enemy2:getDimensions())
end

for frame = 1, totalNumberofFrames do
playerFrames[frame] = love.graphics.newQuad((frame - 1) * playerframeWidth, 0, playerframeWidth, frameHeight,
player:getDimensions())
end

push:setupScreen(VIRTUAL_WIDTH, VIRTUAL_HEIGHT, WINDOW_WIDTH, WINDOW_HEIGHT, {
vsync = true,
fullscreen = false,
resizable = false
})
end

function love.keypressed(key)

if key == "space" then
sounds.shooting:play()
end

if key == "space" then
sounds.shooting:play()
end

if key == "r" then
sounds.reload:play()
end

end


function love.update(dt)

backgroundScroll = (backgroundScroll + BACKGROUND_SCROLL_SPEED * dt)
% BACKGROUND_LOOPING_POINT

midgroundScroll = (midgroundScroll + MIDGROUND_SCROLL_SPEED * dt)
% MIDGROUND_LOOPING_POINT

groundScroll = (groundScroll + GROUND_SCROLL_SPEED * dt)
% WINDOW_WIDTH

timePassedSinceLastFrameChange = timePassedSinceLastFrameChange + dt

if timePassedSinceLastFrameChange > desiredDelayBetweenFrameChanges then
timePassedSinceLastFrameChange = timePassedSinceLastFrameChange - desiredDelayBetweenFrameChanges
currentFrame = currentFrame % totalNumberofFrames + 1
end

enemyx = (enemyx- 0.5) % WINDOW_WIDTH
enemy1x = (enemy1x - 0.4) % WINDOW_WIDTH
enemy2x = (enemy2x - 0.3) % WINDOW_WIDTH

end

function love.draw()

push:start()

love.graphics.draw(background, -backgroundScroll, 0)

love.graphics.draw(midground, -midgroundScroll, 0)

love.graphics.draw(ground, -groundScroll, 0)

love.graphics.draw(enemy2, enemy2Frames[currentFrame], enemy2x, enemy2y)

love.graphics.draw(enemy, enemyFrames[currentFrame], enemyx, enemyy)

love.graphics.draw(enemy1, enemy1Frames[currentFrame], enemy1x, enemy1y)

love.graphics.draw(player, playerFrames[currentFrame], playerx, playery)

love.graphics.draw(logo, -250, -340)

love.graphics.draw(shots, 0, 170)

push:finish()

end