-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Limit by distance * Safer removal * Shoot by default on mobile * deprecation * Mobile
- Loading branch information
Showing
77 changed files
with
1,511 additions
and
309 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
*.test | ||
*.out | ||
vendor/ | ||
go.work |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
version: '3' | ||
|
||
tasks: | ||
mobile: | ||
dir: ./mobile | ||
cmds: | ||
- ebitenmobile bind -target ios -o Airplanes.xcframework . | ||
|
||
mobile-deploy: | ||
deps: | ||
- mobile | ||
dir: ./mobile | ||
cmds: | ||
- xcodebuild -scheme Airplanes -configuration Debug -sdk iphoneos -derivedDataPath build | ||
- ios-deploy --bundle build/Build/Products/Debug-iphoneos/Airplanes.app --nostart --no-wifi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
package archetype | ||
|
||
import ( | ||
"github.com/yohamta/donburi" | ||
"github.com/yohamta/donburi/features/math" | ||
"github.com/yohamta/donburi/features/transform" | ||
|
||
"github.com/m110/airplanes/assets" | ||
"github.com/m110/airplanes/component" | ||
) | ||
|
||
func NewJoystick(w donburi.World, pos math.Vec2) { | ||
joystick := w.Entry(w.Create( | ||
transform.Transform, | ||
component.Joystick, | ||
component.Sprite, | ||
)) | ||
component.Sprite.SetValue(joystick, component.SpriteData{ | ||
Image: assets.JoystickBase, | ||
Layer: component.SpriteLayerUI, | ||
Pivot: component.SpritePivotCenter, | ||
}) | ||
t := transform.Transform.Get(joystick) | ||
t.LocalPosition = pos | ||
t.LocalScale = math.Vec2{X: 0.5, Y: 0.5} | ||
|
||
knob := w.Entry(w.Create( | ||
transform.Transform, | ||
component.Joystick, | ||
component.Sprite, | ||
)) | ||
|
||
component.Sprite.SetValue(knob, component.SpriteData{ | ||
Image: assets.JoystickKnob, | ||
Layer: component.SpriteLayerUI, | ||
Pivot: component.SpritePivotCenter, | ||
}) | ||
transform.AppendChild(joystick, knob, false) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
package component | ||
|
||
import "github.com/yohamta/donburi" | ||
|
||
type DestroyedData struct{} | ||
|
||
var Destroyed = donburi.NewComponentType[DestroyedData]() | ||
|
||
func Destroy(e *donburi.Entry) { | ||
if !e.Valid() { | ||
return | ||
} | ||
if !e.HasComponent(Destroyed) { | ||
e.AddComponent(Destroyed) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
package component | ||
|
||
import ( | ||
"github.com/yohamta/donburi" | ||
"github.com/yohamta/donburi/features/math" | ||
) | ||
|
||
type DistanceLimitData struct { | ||
MaxDistance float64 | ||
|
||
DistanceTraveled float64 | ||
PreviousPosition math.Vec2 | ||
Initialized bool | ||
} | ||
|
||
var DistanceLimit = donburi.NewComponentType[DistanceLimitData]() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
package component | ||
|
||
import "github.com/yohamta/donburi" | ||
|
||
type JoystickData struct { | ||
} | ||
|
||
var Joystick = donburi.NewComponentType[JoystickData]() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
package component | ||
|
||
import ( | ||
"github.com/yohamta/donburi" | ||
|
||
"github.com/m110/airplanes/engine" | ||
) | ||
|
||
type TimeToLiveData struct { | ||
Timer *engine.Timer | ||
} | ||
|
||
var TimeToLive = donburi.NewComponentType[TimeToLiveData]() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
package input |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
//go:build !android && !ios | ||
|
||
package input | ||
|
||
func IsTouchPrimaryInput() bool { | ||
return false | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
//go:build android || ios | ||
|
||
package input | ||
|
||
func IsTouchPrimaryInput() bool { | ||
return true | ||
} |
Oops, something went wrong.