Skip to content

Commit

Permalink
adjustments for difficulty
Browse files Browse the repository at this point in the history
  • Loading branch information
Noofbiz committed Jul 24, 2018
1 parent 6422e6c commit 01a33b8
Show file tree
Hide file tree
Showing 12 changed files with 25 additions and 23 deletions.
Binary file modified android/androidglue/androidglue.aar
Binary file not shown.
Binary file added androidglue/androidglue-sources.jar
Binary file not shown.
Binary file added androidglue/androidglue.aar
Binary file not shown.
2 changes: 0 additions & 2 deletions controllers/controllers_mobile.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
package controllers

import (
"log"
"sync"
)

Expand Down Expand Up @@ -32,7 +31,6 @@ func GetAccelerometerValue() float32 {
}

func NewAccelerometerValue(v float32) {
log.Println(v)
lock.Lock()
value = (v - 0.5) * 6
lock.Unlock()
Expand Down
2 changes: 1 addition & 1 deletion data/opts.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"BGM":true,"SFX":true,"BGMLevel":0.5999990000000001,"SFXLevel":0.5999990000000001,"HighScore":1110,"Controls":"Keyboard"}
{"BGM":true,"SFX":true,"BGMLevel":0.999999,"SFXLevel":0.999999,"HighScore":1550,"Controls":"Keyboard"}
2 changes: 1 addition & 1 deletion scenes/credits/scene.go
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ func (s *Scene) createLines(lines ...string) {
l.SpaceComponent.Width = l.RenderComponent.Drawable.Width() * l.RenderComponent.Scale.X
l.SpaceComponent.Height = l.RenderComponent.Drawable.Height() * l.RenderComponent.Scale.Y
l.SpaceComponent.Position = engo.Point{
X: (320-l.SpaceComponent.Width)/2 + ((320 - engo.WindowWidth()) / (2 * engo.GetGlobalScale().X)),
X: (320-l.SpaceComponent.Width)/2 + options.XOffset,
Y: s.curPos,
}
s.w.AddEntity(&l)
Expand Down
10 changes: 7 additions & 3 deletions systems/bullet/system.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ func (s *System) New(w *ecs.World) {
if !ok {
return
}
s.speed += 0.5
s.speed += 0.75
})
engo.Mailbox.Listen(messages.CreateBulletType, func(m engo.Message) {
msg, ok := m.(messages.CreateBullet)
Expand Down Expand Up @@ -106,8 +106,12 @@ func (s *System) Update(dt float32) {
X: s.speed * sin,
Y: s.speed * cos,
})
if s.entities[i].Position.X < 31+options.XOffset ||
s.entities[i].Position.X > 256+options.XOffset {
if s.entities[i].Position.X < 31+options.XOffset {
s.entities[i].Position.X = 32
s.entities[i].Angle *= -1
}
if s.entities[i].Position.X > 255+options.XOffset {
s.entities[i].Position.X = 254
s.entities[i].Angle *= -1
}
if s.entities[i].Position.Y < options.YOffset {
Expand Down
2 changes: 1 addition & 1 deletion systems/creditroll/system.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ func (s *System) Update(dt float32) {
X: 0,
Y: s.speed * dt,
})
if s.entities[i].Position.Y < -50+options.YOffset {
if s.entities[i].Position.Y < -20+options.YOffset {
s.w.RemoveEntity(*s.entities[i].BasicEntity)
}
}
Expand Down
10 changes: 5 additions & 5 deletions systems/gargoyle/system.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,13 @@ type System struct {
// New is called when the system is added to the World
func (s *System) New(w *ecs.World) {
s.w = w
s.speed = 30
s.speed = 25
s.wait = 7
s.max = 10
s.min = 3
s.increment = 5
s.mincharges = 1
s.randcharges = 3
s.randcharges = 2
engo.Mailbox.Listen(messages.SpeedType, func(m engo.Message) {
_, ok := m.(messages.Speed)
if !ok {
Expand All @@ -44,7 +44,7 @@ func (s *System) New(w *ecs.World) {
s.min -= 0.15
s.increment += 0.5
s.mincharges++
s.randcharges += 2
s.randcharges++
})
engo.Mailbox.Listen(messages.GetPlayerPositionType, func(m engo.Message) {
msg, ok := m.(messages.GetPlayerPosition)
Expand Down Expand Up @@ -115,7 +115,7 @@ func (s *System) Update(dt float32) {
s.entities[i].elapsed = 0
s.entities[i].charges--
}
if s.entities[i].Position.Y < -66+options.YOffset {
if s.entities[i].Position.Y < options.YOffset {
s.w.RemoveEntity(*s.entities[i].BasicEntity)
}
}
Expand All @@ -129,7 +129,7 @@ func (s *System) addGargoyle() {
g.SpaceComponent = common.SpaceComponent{
Position: engo.Point{
X: rand.Float32()*(256-g.RenderComponent.Drawable.Width()) + 32 + options.XOffset,
Y: 480 + options.YOffset,
Y: 460 + options.YOffset,
},
Width: g.RenderComponent.Drawable.Width(),
Height: g.RenderComponent.Drawable.Height(),
Expand Down
4 changes: 2 additions & 2 deletions systems/gem/system.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ func (s *System) New(w *ecs.World) {
s.w = w
s.speed = 50
s.wait = 5
s.max = 15
s.max = 10
s.min = 1
s.increment = 3

Expand Down Expand Up @@ -113,7 +113,7 @@ func (s *System) Update(dt float32) {
}
for i := 0; i < len(s.entities); i++ {
s.entities[i].Position.Subtract(engo.Point{X: 0, Y: s.speed * dt})
if s.entities[i].Position.Y < -32+options.YOffset {
if s.entities[i].Position.Y < options.YOffset {
s.w.RemoveEntity(*s.entities[i].BasicEntity)
}
}
Expand Down
14 changes: 7 additions & 7 deletions systems/potion/system.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@ type System struct {
func (s *System) New(w *ecs.World) {
s.w = w
s.speed = 30
s.wait = 15
s.max = 20
s.min = 5
s.increment = 5
s.wait = 5
s.max = 10
s.min = 3
s.increment = 2

s.player, _ = common.LoadedPlayer("potion.wav")
s.player.SetVolume(options.TheOptions.SFXLevel)
Expand All @@ -40,9 +40,9 @@ func (s *System) New(w *ecs.World) {
return
}
s.speed += 5
s.max -= 1.75
s.max -= 0.75
s.min -= 0.25
s.increment += 0.5
s.increment += 0.25
})

engo.Mailbox.Listen("CollisionMessage", func(m engo.Message) {
Expand Down Expand Up @@ -113,7 +113,7 @@ func (s *System) Update(dt float32) {
}
for i := 0; i < len(s.entities); i++ {
s.entities[i].Position.Subtract(engo.Point{X: 0, Y: s.speed * dt})
if s.entities[i].Position.Y < -32+options.YOffset {
if s.entities[i].Position.Y < options.YOffset {
s.w.RemoveEntity(*s.entities[i].BasicEntity)
}
}
Expand Down
2 changes: 1 addition & 1 deletion systems/speed/system.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"github.com/Noofbiz/hypnic/messages"
)

var timer []float32 = []float32{20, 25, 15, 10, 10}
var timer = []float32{8, 8, 5, 4, 6}

type System struct {
times int
Expand Down

0 comments on commit 01a33b8

Please sign in to comment.