Skip to content

Commit

Permalink
nogame screen uses non-deprecated APIs
Browse files Browse the repository at this point in the history
  • Loading branch information
slime73 committed Oct 7, 2023
1 parent de3a0c0 commit 5b47588
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 21 deletions.
10 changes: 5 additions & 5 deletions src/scripts/nogame.lua
Original file line number Diff line number Diff line change
Expand Up @@ -2948,9 +2948,8 @@ function love.nogame()
self.body = love.physics.newBody(world, x, y, "dynamic")
self.body:setLinearDamping(0.8)
self.body:setAngularDamping(0.8)
self.shape = love.physics.newPolygonShape(-55, -60, 0, 90, 55, -60)
self.fixture = love.physics.newFixture(self.body, self.shape, 1)
self.fixture:setRestitution(0.5)
self.shape = love.physics.newPolygonShape(self.body, -55, -60, 0, 90, 55, -60)
self.shape:setRestitution(0.5)
self.img_normal = img_duckloon_normal
self.img_blink = img_duckloon_blink
self.img = self.img_normal
Expand Down Expand Up @@ -3041,8 +3040,9 @@ function love.nogame()
link.body = love.physics.newBody(world, link.x, link.y, "dynamic")
link.body:setLinearDamping(0.5)
link.body:setAngularDamping(0.5)
link.shape = love.physics.newCircleShape(link.radius)
link.fixture = love.physics.newFixture(link.body, link.shape, 0.1 / i)
link.shape = love.physics.newCircleShape(link.body, link.radius)
link.shape:setDensity(0.1 / i)
link.body:resetMassData()
link.state = State(link.body)

-- Note: every link must also be attached to the Duckloon. Otherwise the
Expand Down
28 changes: 12 additions & 16 deletions src/scripts/nogame.lua.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ const unsigned char nogame_lua[] =

0x2d, 0x2d, 0x5b, 0x5b, 0x0a,
0x43, 0x6f, 0x70, 0x79, 0x72, 0x69, 0x67, 0x68, 0x74, 0x20, 0x28, 0x63, 0x29, 0x20, 0x32, 0x30, 0x30, 0x36,
0x2d, 0x32, 0x30, 0x32, 0x31, 0x20, 0x4c, 0x4f, 0x56, 0x45, 0x20, 0x44, 0x65, 0x76, 0x65, 0x6c, 0x6f, 0x70,
0x2d, 0x32, 0x30, 0x32, 0x33, 0x20, 0x4c, 0x4f, 0x56, 0x45, 0x20, 0x44, 0x65, 0x76, 0x65, 0x6c, 0x6f, 0x70,
0x6d, 0x65, 0x6e, 0x74, 0x20, 0x54, 0x65, 0x61, 0x6d, 0x0a,
0x0a,
0x54, 0x68, 0x69, 0x73, 0x20, 0x73, 0x6f, 0x66, 0x74, 0x77, 0x61, 0x72, 0x65, 0x20, 0x69, 0x73, 0x20, 0x70,
Expand Down Expand Up @@ -11440,14 +11440,11 @@ const unsigned char nogame_lua[] =
0x75, 0x6c, 0x61, 0x72, 0x44, 0x61, 0x6d, 0x70, 0x69, 0x6e, 0x67, 0x28, 0x30, 0x2e, 0x38, 0x29, 0x0a,
0x09, 0x09, 0x73, 0x65, 0x6c, 0x66, 0x2e, 0x73, 0x68, 0x61, 0x70, 0x65, 0x20, 0x3d, 0x20, 0x6c, 0x6f, 0x76,
0x65, 0x2e, 0x70, 0x68, 0x79, 0x73, 0x69, 0x63, 0x73, 0x2e, 0x6e, 0x65, 0x77, 0x50, 0x6f, 0x6c, 0x79, 0x67,
0x6f, 0x6e, 0x53, 0x68, 0x61, 0x70, 0x65, 0x28, 0x2d, 0x35, 0x35, 0x2c, 0x20, 0x2d, 0x36, 0x30, 0x2c, 0x20,
0x30, 0x2c, 0x20, 0x39, 0x30, 0x2c, 0x20, 0x35, 0x35, 0x2c, 0x20, 0x2d, 0x36, 0x30, 0x29, 0x0a,
0x09, 0x09, 0x73, 0x65, 0x6c, 0x66, 0x2e, 0x66, 0x69, 0x78, 0x74, 0x75, 0x72, 0x65, 0x20, 0x3d, 0x20, 0x6c,
0x6f, 0x76, 0x65, 0x2e, 0x70, 0x68, 0x79, 0x73, 0x69, 0x63, 0x73, 0x2e, 0x6e, 0x65, 0x77, 0x46, 0x69, 0x78,
0x74, 0x75, 0x72, 0x65, 0x28, 0x73, 0x65, 0x6c, 0x66, 0x2e, 0x62, 0x6f, 0x64, 0x79, 0x2c, 0x20, 0x73, 0x65,
0x6c, 0x66, 0x2e, 0x73, 0x68, 0x61, 0x70, 0x65, 0x2c, 0x20, 0x31, 0x29, 0x0a,
0x09, 0x09, 0x73, 0x65, 0x6c, 0x66, 0x2e, 0x66, 0x69, 0x78, 0x74, 0x75, 0x72, 0x65, 0x3a, 0x73, 0x65, 0x74,
0x52, 0x65, 0x73, 0x74, 0x69, 0x74, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x30, 0x2e, 0x35, 0x29, 0x0a,
0x6f, 0x6e, 0x53, 0x68, 0x61, 0x70, 0x65, 0x28, 0x73, 0x65, 0x6c, 0x66, 0x2e, 0x62, 0x6f, 0x64, 0x79, 0x2c,
0x20, 0x2d, 0x35, 0x35, 0x2c, 0x20, 0x2d, 0x36, 0x30, 0x2c, 0x20, 0x30, 0x2c, 0x20, 0x39, 0x30, 0x2c, 0x20,
0x35, 0x35, 0x2c, 0x20, 0x2d, 0x36, 0x30, 0x29, 0x0a,
0x09, 0x09, 0x73, 0x65, 0x6c, 0x66, 0x2e, 0x73, 0x68, 0x61, 0x70, 0x65, 0x3a, 0x73, 0x65, 0x74, 0x52, 0x65,
0x73, 0x74, 0x69, 0x74, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x30, 0x2e, 0x35, 0x29, 0x0a,
0x09, 0x09, 0x73, 0x65, 0x6c, 0x66, 0x2e, 0x69, 0x6d, 0x67, 0x5f, 0x6e, 0x6f, 0x72, 0x6d, 0x61, 0x6c, 0x20,
0x3d, 0x20, 0x69, 0x6d, 0x67, 0x5f, 0x64, 0x75, 0x63, 0x6b, 0x6c, 0x6f, 0x6f, 0x6e, 0x5f, 0x6e, 0x6f, 0x72,
0x6d, 0x61, 0x6c, 0x0a,
Expand Down Expand Up @@ -11619,13 +11616,12 @@ const unsigned char nogame_lua[] =
0x67, 0x75, 0x6c, 0x61, 0x72, 0x44, 0x61, 0x6d, 0x70, 0x69, 0x6e, 0x67, 0x28, 0x30, 0x2e, 0x35, 0x29, 0x0a,
0x09, 0x09, 0x09, 0x6c, 0x69, 0x6e, 0x6b, 0x2e, 0x73, 0x68, 0x61, 0x70, 0x65, 0x20, 0x3d, 0x20, 0x6c, 0x6f,
0x76, 0x65, 0x2e, 0x70, 0x68, 0x79, 0x73, 0x69, 0x63, 0x73, 0x2e, 0x6e, 0x65, 0x77, 0x43, 0x69, 0x72, 0x63,
0x6c, 0x65, 0x53, 0x68, 0x61, 0x70, 0x65, 0x28, 0x6c, 0x69, 0x6e, 0x6b, 0x2e, 0x72, 0x61, 0x64, 0x69, 0x75,
0x73, 0x29, 0x0a,
0x09, 0x09, 0x09, 0x6c, 0x69, 0x6e, 0x6b, 0x2e, 0x66, 0x69, 0x78, 0x74, 0x75, 0x72, 0x65, 0x20, 0x3d, 0x20,
0x6c, 0x6f, 0x76, 0x65, 0x2e, 0x70, 0x68, 0x79, 0x73, 0x69, 0x63, 0x73, 0x2e, 0x6e, 0x65, 0x77, 0x46, 0x69,
0x78, 0x74, 0x75, 0x72, 0x65, 0x28, 0x6c, 0x69, 0x6e, 0x6b, 0x2e, 0x62, 0x6f, 0x64, 0x79, 0x2c, 0x20, 0x6c,
0x69, 0x6e, 0x6b, 0x2e, 0x73, 0x68, 0x61, 0x70, 0x65, 0x2c, 0x20, 0x30, 0x2e, 0x31, 0x20, 0x2f, 0x20, 0x69,
0x29, 0x0a,
0x6c, 0x65, 0x53, 0x68, 0x61, 0x70, 0x65, 0x28, 0x6c, 0x69, 0x6e, 0x6b, 0x2e, 0x62, 0x6f, 0x64, 0x79, 0x2c,
0x20, 0x6c, 0x69, 0x6e, 0x6b, 0x2e, 0x72, 0x61, 0x64, 0x69, 0x75, 0x73, 0x29, 0x0a,
0x09, 0x09, 0x09, 0x6c, 0x69, 0x6e, 0x6b, 0x2e, 0x73, 0x68, 0x61, 0x70, 0x65, 0x3a, 0x73, 0x65, 0x74, 0x44,
0x65, 0x6e, 0x73, 0x69, 0x74, 0x79, 0x28, 0x30, 0x2e, 0x31, 0x20, 0x2f, 0x20, 0x69, 0x29, 0x0a,
0x09, 0x09, 0x09, 0x6c, 0x69, 0x6e, 0x6b, 0x2e, 0x62, 0x6f, 0x64, 0x79, 0x3a, 0x72, 0x65, 0x73, 0x65, 0x74,
0x4d, 0x61, 0x73, 0x73, 0x44, 0x61, 0x74, 0x61, 0x28, 0x29, 0x0a,
0x09, 0x09, 0x09, 0x6c, 0x69, 0x6e, 0x6b, 0x2e, 0x73, 0x74, 0x61, 0x74, 0x65, 0x20, 0x3d, 0x20, 0x53, 0x74,
0x61, 0x74, 0x65, 0x28, 0x6c, 0x69, 0x6e, 0x6b, 0x2e, 0x62, 0x6f, 0x64, 0x79, 0x29, 0x0a,
0x0a,
Expand Down

0 comments on commit 5b47588

Please sign in to comment.