Skip to content

Commit

Permalink
github.com/goplus/spx v1.0.0-beta8
Browse files Browse the repository at this point in the history
  • Loading branch information
xushiwei committed Dec 2, 2021
2 parents 98ae795 + 17b3395 commit e5f92da
Show file tree
Hide file tree
Showing 9 changed files with 68 additions and 4 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,5 @@ gop.mod

# Dependency directories (remove the comment below to include it)
# vendor/
assets
AircraftWar.apk
7 changes: 5 additions & 2 deletions GameOver.spx
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
onMsg "msgBattle", =>{
hide
}
onMsg msgGameOver, => {
show
wait 2
exit
wait 0.8
broadcast "reset game"
}
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,7 @@ AircraftWar - a game powered by Go+ spx game engine
* git clone https://github.com/goplus/AircraftWar.git
* cd AircraftWar
* ./run.sh

- Download GoMobile and build it. See golang.org/x/mobile.
- Build Mobile
* ./buildmobile.sh
24 changes: 24 additions & 0 deletions Reset.spx
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
onMsg "reset game", => {
wait 0.5
gotoFront
show
for {
if touching(Mouse) {
setYpos -90
} else {
setYpos -95
}
wait 0.1
}
}

onMsg "menu", => {
hide
setXYpos 0, -100
}

onClick => {
hide
wait 0.3
reset
}
7 changes: 7 additions & 0 deletions buildmobile.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
go mod tidy
rm -f .gop/gop.cache
gop build .
rm -rf AircraftWar
mkdir assets
cp -R ./res assets/
gomobile build --tags canvas -target=android -androidapi 29
5 changes: 4 additions & 1 deletion index.gmx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ var (
SmallEnemy SmallEnemy
GameOver GameOver
YouWin YouWin

Reset Reset
bombs int
score int
)
Expand All @@ -33,5 +33,8 @@ func addScore(val int) {
broadcast msgYouWin
}
}
func reset(){
reload "index.json"
}

run "res", {Title: "Aircraft War (by Go+)"}
3 changes: 2 additions & 1 deletion res/index.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@
"Bullet",
"SmallEnemy",
"YouWin",
"GameOver"
"GameOver",
"Reset"
]
}
20 changes: 20 additions & 0 deletions res/sprites/Reset/index.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"costumes": [
{
"bitmapResolution": 2,
"faceRight": 0,
"name": "Reset",
"path": "reset2.png",
"x":97,
"y":35
}
],
"currentCostumeIndex": 0,
"heading": 90,
"isDraggable": false,
"rotationStyle": "normal",
"size": 1.0,
"visible": false,
"x": 0,
"y": 0
}
Binary file added res/sprites/Reset/reset2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit e5f92da

Please sign in to comment.