Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
P
PlayThrust
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Package registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Procter Projects
PlayThrust
Commits
6788a782
Commit
6788a782
authored
2 years ago
by
Adam Procter
Browse files
Options
Downloads
Patches
Plain Diff
more tests to get thrust pinned to the tail
parent
6f1923cc
No related branches found
No related tags found
No related merge requests found
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
Builds/PlayThrust.pdx/main.pdz
+0
-0
0 additions, 0 deletions
Builds/PlayThrust.pdx/main.pdz
Builds/PlayThrust.pdx/pdxinfo
+1
-1
1 addition, 1 deletion
Builds/PlayThrust.pdx/pdxinfo
main.lua
+14
-10
14 additions, 10 deletions
main.lua
with
15 additions
and
11 deletions
Builds/PlayThrust.pdx/main.pdz
+
0
−
0
View file @
6788a782
No preview for this file type
This diff is collapsed.
Click to expand it.
Builds/PlayThrust.pdx/pdxinfo
+
1
−
1
View file @
6788a782
...
...
@@ -5,4 +5,4 @@ bundleID=uk.co.adamprocter.playthrust
version=0.0.1
imagePath=images
pdxversion=11200
buildtime=7260
16473
buildtime=7260
86797
This diff is collapsed.
Click to expand it.
main.lua
+
14
−
10
View file @
6788a782
...
...
@@ -20,6 +20,10 @@ local shipDy = 0
local
thrustShip
=
nil
local
gravity
=
1
.
5
-- for thrust
newShipX
=
nil
newShipY
=
nil
-- viewport
-- 400 x 240 screen
local
xOffsetmin
=
100
...
...
@@ -51,6 +55,7 @@ function myGameSetUp()
playerShip
:
setCollideRect
(
0
,
0
,
32
,
32
)
playerShip
:
add
()
-- set up thrust
thrustShip
=
gfx
.
sprite
.
new
()
assert
(
thrustShip
)
...
...
@@ -114,6 +119,7 @@ function playerShip:update()
gfx
.
setColor
(
gfx
.
kColorBlack
)
gfx
.
drawPolygon
(
playerShip
.
polygon
)
gfx
.
popContext
()
playerShip
:
setImage
(
img
)
...
...
@@ -149,28 +155,26 @@ function playerShip:update()
if
(
spY
>
yOffsetmax
and
shipDy
>=
0
)
then
shipMoveDy
=
0
end
-- if (spX > xOffsetmin and spX < xOffsetmax and spY > yOffsetmin and spY < yOffsetmax) then
-- if ()
-- end
newShipX
=
shipMoveDx
+
spX
newShipY
=
shipMoveDy
+
spY
playerShip
:
moveWithCollisions
(
shipMoveDx
+
spX
,
shipMoveDy
+
spY
)
end
function
thrustShip
:
update
()
local
spX
,
spY
=
playerShip
:
getPosition
()
local
img
=
gfx
.
image
.
new
(
32
,
32
)
local
angle
=
playdate
.
getCrankPosition
()
gfx
.
pushContext
(
img
)
gfx
.
setColor
(
gfx
.
kColorWhite
)
gfx
.
fillPolygon
(
thrustShip
.
polygon
)
gfx
.
setColor
(
gfx
.
kColorBlack
)
gfx
.
drawPolygon
(
thrustShip
.
polygon
)
gfx
.
popContext
()
thrustShip
:
setImage
(
img
)
thrustShip
:
moveTo
(
spX
+
8
,
spY
+
36
)
thrustShip
:
setZIndex
(
60
)
-- thrustShip:moveTo(spX+8,spY+36)
local
angle
=
playdate
.
getCrankPosition
()
thrustShip
:
moveTo
(
newShipX
+
(
32
*
math.sin
(
math.rad
(
angle
))),
newShipY
+
36
)
thrustShip
:
setZIndex
(
60
)
thrustShip
.
thrust_transform
:
rotate
(
playdate
.
getCrankChange
(),
16
,
-
16
)
thrustShip
.
thrust_transform
:
transformPolygon
(
thrustShip
.
polygon
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment