Skip to content

Commit

Permalink
Fix for new path system
Browse files Browse the repository at this point in the history
  • Loading branch information
dimkauzh committed Oct 17, 2023
1 parent 91e44b0 commit 55ee975
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 12 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ example:
@echo " ----------------------------------------------------"
@echo

$(EXAMPLE_BUILD_TOOL) ./example/
$(EXAMPLE_BUILD_TOOL) ./example/example.go

release:
@echo
Expand Down
2 changes: 1 addition & 1 deletion example/example.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package main

import (
// Import the webzen package
"github.com/dimkauzh/webzen"
"github.com/dimkauzh/webzen/"

// Import the webzen draw package
"github.com/dimkauzh/webzen/src/draw"
Expand Down
10 changes: 5 additions & 5 deletions src/entity/entity.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,21 +4,21 @@
package entity

import (
"github.com/dimkauzh/webzen/src/webzen/image"
"github.com/dimkauzh/webzen/src/webzen/shape"
"github.com/dimkauzh/webzen/src/image"
"github.com/dimkauzh/webzen/src/shape"
"github.com/dimkauzh/webzen/src/vector"
)

type Entity struct {
x int
y int
pos vector.Vector2D
width int
height int
image image.Image
rect shape.Rect
}

func NewEntity(x int, y int, width int, height int) Entity {
return Entity{x, y, width, height, nil, nil}
return Entity{vector.NewVector2D(x, y), width, height, nil, nil}
}

func (e *Entity) SetImage(image image.Image) {
Expand Down
14 changes: 9 additions & 5 deletions tests/test1/test1.go
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
package main

import (
"github.com/dimkauzh/webzen/src/webzen"
"github.com/dimkauzh/webzen/src/webzen/draw"
"github.com/dimkauzh/webzen/src/webzen/keys"
"github.com/dimkauzh/webzen/src/webzen/tools"
"github.com/dimkauzh/webzen/src/webzen/ui"
"github.com/dimkauzh/webzen"
"github.com/dimkauzh/webzen/src/draw"
"github.com/dimkauzh/webzen/src/keys"
"github.com/dimkauzh/webzen/src/tools"
"github.com/dimkauzh/webzen/src/ui"
)

func main() {
Expand All @@ -23,6 +23,10 @@ func main() {
if keys.KeyPressedOnce("a") {
tools.Print("A key pressed")
}

pos := keys.GetMousePos()

Check failure on line 27 in tests/test1/test1.go

View workflow job for this annotation

GitHub Actions / build

undefined: keys.GetMousePos

tools.Print(pos[0], pos[1])
webzen.Update()
}
}

0 comments on commit 55ee975

Please sign in to comment.