Running Trosh under LOVE 0.9

Problems running games? Right in here.
jn_
Posts: 1
Joined: 06 Nov 2015, 14:48
Reputation: 0

Post » 06 Nov 2015, 15:01

Hi, I found Trosh today, great game.

it didn't, however, run under Love 0.9 (which is currently shipped in Debian Linux). Here's a patch that adds compatibility with Love 0.9:

Code: Select all

diff --git a/bigexplosion.lua b/bigexplosion.lua
index 6e6a53d..289f718 100644
--- a/bigexplosion.lua
+++ b/bigexplosion.lua
@@ -24,7 +24,7 @@ function bigexplosion:draw()
       love.graphics.setColor(255, 255, 255, 255*math.min(1, math.max(0, (1-starttimer/7))))
    end
    if self.quad <= 25 then
-      love.graphics.drawq(bigexplosionimg, bigexplosionquad[self.quad], self.x*scale, self.y*scale, 0, scale, scale)
+      love.graphics.draw(bigexplosionimg, bigexplosionquad[self.quad], self.x*scale, self.y*scale, 0, scale, scale)
    end
    love.graphics.setColor(r, g, b)
 end
\ No newline at end of file
diff --git a/bird.lua b/bird.lua
index 69fa2b6..91cf12a 100644
--- a/bird.lua
+++ b/bird.lua
@@ -48,5 +48,5 @@ function bird:checkcol(x, y)
 end
 
 function bird:draw()
-   love.graphics.drawq(birdimg, birdquad[self.quad], self.x*scale, self.y*scale, 0, scale/2, scale/2, 14, 8)
+   love.graphics.draw(birdimg, birdquad[self.quad], self.x*scale, self.y*scale, 0, scale/2, scale/2, 14, 8)
 end
\ No newline at end of file
diff --git a/conf.lua b/conf.lua
index 0bdaf1a..288f41f 100644
--- a/conf.lua
+++ b/conf.lua
@@ -2,8 +2,8 @@ function love.conf(t)
    t.title = "TROSH: The Movie: The Game"
    t.author = "Maurice"
    t.console = false
-   t.screen.vsync = true
-   t.screen.width = 800
-   t.screen.height = 640
-   t.screen.fsaa = 0
-end
\ No newline at end of file
+   t.window.vsync = true
+   t.window.width = 800
+   t.window.height = 640
+   t.window.fsaa = 0
+end
diff --git a/enemy.lua b/enemy.lua
index abf285e..8ccc9c0 100644
--- a/enemy.lua
+++ b/enemy.lua
@@ -60,5 +60,5 @@ function enemy:checkcol(x, y, newx)
 end
 
 function enemy:draw()
-   love.graphics.drawq(enemyimg, enemyquad[self.quad], self.x*scale, self.y*scale, 0, 0.1875*scale, 0.1875*scale)
+   love.graphics.draw(enemyimg, enemyquad[self.quad], self.x*scale, self.y*scale, 0, 0.1875*scale, 0.1875*scale)
 end
\ No newline at end of file
diff --git a/explosion.lua b/explosion.lua
index 419ebe5..48be23b 100644
--- a/explosion.lua
+++ b/explosion.lua
@@ -21,5 +21,5 @@ function explosion:update(dt)
 end
 
 function explosion:draw()
-   love.graphics.drawq(explosionimg, explosionquad[self.quad], self.x*scale, self.y*scale, 0, 0.375*scale, 0.375*scale)
+   love.graphics.draw(explosionimg, explosionquad[self.quad], self.x*scale, self.y*scale, 0, 0.375*scale, 0.375*scale)
 end
\ No newline at end of file
diff --git a/main.lua b/main.lua
index 70ca008..0c74d31 100644
--- a/main.lua
+++ b/main.lua
@@ -1,5 +1,5 @@
 function love.load()
-   love.graphics.setDefaultImageFilter("nearest", "nearest")
+   love.graphics.setDefaultFilter("nearest", "nearest")
    
    require "class"
    require "menu"
@@ -24,7 +24,7 @@ function love.load()
    require "bullet"
    require "bird"
    
-   love.graphics.setIcon( love.graphics.newImage("graphics/icon.png") )
+   love.window.setIcon( love.graphics.newImage("graphics/icon.png"):getData() )
    imagelist = {"title", "cloud1", "cloud2", "ground", "bush1", "bush2", "powerup", "rocket", "star", "asteroid-big1", "sunglasses", "awesome", "arrow", "groundwin",
             "asteroid-big2", "asteroid-small1", "asteroid-small2", "bullet", "littleexplosion", "warning", "wheatley", "alert", "randomshit", "bird"}
    
@@ -82,11 +82,12 @@ function love.load()
    birdquad = {love.graphics.newQuad(0, 0, 29, 16, 29, 32), love.graphics.newQuad(0, 16, 29, 16, 29, 32)}
    
    scale = 8
-   local w, h = love.graphics.getMode()
+   local w, h = love.window.getMode()
    if w ~= 100*scale or h ~= 80*scale then
-      love.graphics.setMode(100*scale, 80*scale, false, true, 0)
+      local flags = { fullscreen = false, vsync = true, fsaa = 0 }
+      love.window.setMode(100*scale, 80*scale, flags)
    end
-   love.graphics.setIcon( love.graphics.newImage("graphics/icon.png") )
+   love.window.setIcon( love.graphics.newImage("graphics/icon.png"):getData() )
    
    bgmusic = love.audio.newSource("audio/trosong.ogg")
    bgmusic:setLooping(true)
@@ -267,7 +268,7 @@ function properprint(s, x, y, sc)
       else
          local char = string.sub(s, i, i)
          if fontquads[char] then
-            love.graphics.drawq(fontimage, fontquads[char], x*scale+((i-1)*8+1)*sc, y*scale, 0, sc, sc)
+            love.graphics.draw(fontimage, fontquads[char], x*scale+((i-1)*8+1)*sc, y*scale, 0, sc, sc)
          end
       end
    end
@@ -313,4 +314,4 @@ function getrainbowcolor(i, whiteness)
    end
    
    return {math.min(255, round(r*whiteness)+add), math.min(255, round(g*whiteness)+add), math.min(255, round(b*whiteness)+add), 255}
-end
\ No newline at end of file
+end
diff --git a/menu.lua b/menu.lua
index 4c671b1..63c9786 100644
--- a/menu.lua
+++ b/menu.lua
@@ -87,7 +87,7 @@ function menu_draw()
       v:draw()
    end
    
-   love.graphics.drawq(playerimg, playerquad[playerframe], playerx*scale, playery*scale, 0, scale, scale, 7, 12)
+   love.graphics.draw(playerimg, playerquad[playerframe], playerx*scale, playery*scale, 0, scale, scale, 7, 12)
    for i, v in pairs(lasers) do
       v:draw()
    end
@@ -122,4 +122,4 @@ function menu_draw()
    end
    
    love.graphics.setColor(255, 255, 255)
-end
\ No newline at end of file
+end
diff --git a/scene1.lua b/scene1.lua
index 060406c..19e01cc 100644
--- a/scene1.lua
+++ b/scene1.lua
@@ -172,7 +172,7 @@ function scene1_draw()
       rockets[1]:draw()
    end
    
-   love.graphics.drawq(playerimg, playerquad[playerframe], playerx*scale, playery*scale, 0, scale, scale, 7, 12)
+   love.graphics.draw(playerimg, playerquad[playerframe], playerx*scale, playery*scale, 0, scale, scale, 7, 12)
    for i, v in pairs(lasers) do
       v:draw()
    end
diff --git a/scene4.lua b/scene4.lua
index 7fd71e7..dda283b 100644
--- a/scene4.lua
+++ b/scene4.lua
@@ -139,7 +139,7 @@ function scene4_draw()
       if rockets[1] then
          off = rockets[1].startingoffset
       end
-      love.graphics.drawq(playerimg, playerquad[flyingquad], (playerx+off)*scale, playery*scale, 0, scale, scale, 13, 6)
+      love.graphics.draw(playerimg, playerquad[flyingquad], (playerx+off)*scale, playery*scale, 0, scale, scale, 13, 6)
    end
    
    if rockets[1] then
diff --git a/scene5.lua b/scene5.lua
index 404eb41..5dda4b2 100644
--- a/scene5.lua
+++ b/scene5.lua
@@ -191,7 +191,7 @@ function scene5_draw()
       draw(groundwinimg, -200+landingx+2, groundy)
    end
    
-   love.graphics.drawq(playerimg, playerquad[flyingquad], (playerx)*scale, playery*scale, 0, scale, scale, 13, 6)
+   love.graphics.draw(playerimg, playerquad[flyingquad], (playerx)*scale, playery*scale, 0, scale, scale, 13, 6)
    
    
    if sunglasses then
diff --git a/scene6.lua b/scene6.lua
index 27f1766..f74ffb3 100644
--- a/scene6.lua
+++ b/scene6.lua
@@ -152,7 +152,7 @@ function scene6_draw()
    end
    
    draw(groundwinimg, -168-landdiff, 56)
-   love.graphics.drawq(winplayerimg, winplayerquad[playerquad], 30*scale, 55*scale, 0, scale, scale, 5, 13)
+   love.graphics.draw(winplayerimg, winplayerquad[playerquad], 30*scale, 55*scale, 0, scale, scale, 5, 13)
    
    love.graphics.translate(20*scale, 50*scale)
    love.graphics.rotate(-math.pi/7)
diff --git a/splatter.lua b/splatter.lua
index 2c974dd..2767f8d 100644
--- a/splatter.lua
+++ b/splatter.lua
@@ -19,5 +19,5 @@ function splatter:update(dt)
 end
 
 function splatter:draw()
-   love.graphics.drawq(splatterimg, splatterquad[self.quad], self.x*scale, self.y*scale, 0, scale/2, scale/2, 40, 40)
+   love.graphics.draw(splatterimg, splatterquad[self.quad], self.x*scale, self.y*scale, 0, scale/2, scale/2, 40, 40)
 end
\ No newline at end of file



I would have attached it as a file, but I didn't find a button to do so.

Technochips
User avatar
Posts: 661
Joined: 12 Mar 2015, 16:05
Reputation: 180
Contact:

Post » 06 Nov 2015, 15:16

just upload it on mediafire or dropbox

Mirfielnichtsein
Posts: 1
Joined: 10 Jan 2016, 22:07
Reputation: 0

Post » 10 Jan 2016, 22:11

How do I apply the patch?


Return to “Technical support”

Who is online

Users browsing this forum: No registered users and 1 guest