Skip to content

Commit

Permalink
assets: Added a 43 offset on X and Y
Browse files Browse the repository at this point in the history
So then the map is more fluent in sense of top and down, feels more natural
  • Loading branch information
xescugc committed Jan 31, 2024
1 parent ba51e62 commit 52ad2b2
Show file tree
Hide file tree
Showing 16 changed files with 1,072 additions and 3,700 deletions.
Binary file modified assets/maps/2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified assets/maps/3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified assets/maps/4.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified assets/maps/5.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified assets/maps/6.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 1 addition & 2 deletions client/map.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,7 @@ func (m *Map) Draw(screen *ebiten.Image) {
// part that it's seen by the user
// If we want to render everything and just move the viewport around we need o render the full image and change the
// opt.GeoM.Transport to the Map.X/Y and change the Update function to do the opposite in terms of -+
//
// TODO: Maybe create a self Map entity with Update/Draw

op := &ebiten.DrawImageOptions{}
s := m.game.Camera.GetState().(CameraState)
op.GeoM.Scale(s.Zoom, s.Zoom)
Expand Down
6 changes: 5 additions & 1 deletion client/new.go
Original file line number Diff line number Diff line change
Expand Up @@ -82,11 +82,15 @@ func wsHandler(ctx context.Context) {
}

actionDispatcher.Dispatch(act)
// If the action is StartGame then we
// focus the user on it's own line
if act.Type == action.StartGame {
actionDispatcher.GoHome()
}
}
}

func wsSend(a *action.Action) {
// TODO: ADD THE ROOM
err := wsjson.Write(context.Background(), wsc, a)
if err != nil {
log.Fatal(err)
Expand Down
Binary file modified server/assets/wasm/maze-wars.wasm
Binary file not shown.
2 changes: 1 addition & 1 deletion server/rooms.go
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ func (rs *RoomsStore) Reduce(state, a interface{}) interface{} {
Players: make(map[string]PlayerConn),
Connections: make(map[string]string),

Size: 6,
Size: 2,
Countdown: 10,
}
rstate.CurrentWaitingRoom = rid.String()
Expand Down
18 changes: 9 additions & 9 deletions store/map.go
Original file line number Diff line number Diff line change
Expand Up @@ -94,38 +94,38 @@ func (m *Map) GetRandomSpawnCoordinatesForLineID(lid int) (float64, float64) {
// The area is of 112

p := rand.Intn(112)
yy := (p%7)*16 + 16
xx := ((p%16)*16 + 16) + (lid * 16 * (16 + 1 + 10 + 1))
yy := (43 * 16) + (p%7)*16 + 16
xx := (43 * 16) + ((p%16)*16 + 16) + (lid * 16 * (16 + 1 + 10 + 1))

return float64(xx), float64(yy)
}

func (m *Map) GetHomeCoordinates(lid int) (float64, float64) {
return float64(lid * 16 * (16 + 1 + 10 + 1)), 0
return float64(lid*16*(16+1+10+1) + (43 * 16)), (43 * 16)
}

func (m *Map) EndZone(lid int) utils.Object {
return utils.Object{
X: float64(16 + (lid * 16 * (16 + 1 + 10 + 1))),
Y: 82 * 16,
X: float64((43 * 16) + 16 + (lid * 16 * (16 + 1 + 10 + 1))),
Y: 82*16 + (43 * 16),
W: 16 * 16,
H: 3 * 16,
}
}

func (m *Map) BuildingZone(lid int) utils.Object {
return utils.Object{
X: float64(16 + (lid * 16 * (16 + 1 + 10 + 1))),
Y: (7 * 16) + 16, // This +16 is for the border
X: float64((43 * 16) + 16 + (lid * 16 * (16 + 1 + 10 + 1))),
Y: (7 * 16) + 16 + (43 * 16), // This +16 is for the border
W: 16 * 16,
H: 74 * 16,
}
}

func (m *Map) UnitZone(lid int) utils.Object {
return utils.Object{
X: float64(16 + (lid * 16 * (16 + 1 + 10 + 1))),
Y: 16, // This +16 is for the border
X: float64((43 * 16) + 16 + (lid * 16 * (16 + 1 + 10 + 1))),
Y: 16 + (43 * 16), // This +16 is for the border
W: 16 * 16,
H: 81 * 16,
}
Expand Down
502 changes: 175 additions & 327 deletions tiled/1v1.tmx

Large diffs are not rendered by default.

181 changes: 181 additions & 0 deletions tiled/2.tmx

Large diffs are not rendered by default.

718 changes: 175 additions & 543 deletions tiled/3.tmx

Large diffs are not rendered by default.

934 changes: 175 additions & 759 deletions tiled/4.tmx

Large diffs are not rendered by default.

1,150 changes: 175 additions & 975 deletions tiled/5.tmx

Large diffs are not rendered by default.

1,258 changes: 175 additions & 1,083 deletions tiled/6.tmx

Large diffs are not rendered by default.

0 comments on commit 52ad2b2

Please sign in to comment.