Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

assets: Added a 43 offset on X and Y on the map #144

Merged
merged 1 commit into from
Jan 31, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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.

Loading