Skip to content

Commit

Permalink
algunos cambios no importantes
Browse files Browse the repository at this point in the history
  • Loading branch information
Troxsoft committed Dec 3, 2023
1 parent 4d6468c commit 9633c4c
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 3 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ Un motor de videojuego escrito usando Golang 100% usando la poderosa libreria Ra

![Raylib](https://github.com/raysan5/raylib)
![Raylib-go](https://github.com/gen2brain/raylib-go)

### Ejemplo
- Hola cuadrado
```go
Expand Down
9 changes: 9 additions & 0 deletions engine/gameObject.go
Original file line number Diff line number Diff line change
Expand Up @@ -107,13 +107,22 @@ func (g *GameObject) IsInGroup(gr string) bool {
}
return false
}

func (g *GameObject) Position() Position {
return g.position
}

/*
physics type: Colliders and collisions[OFF]
*/
func (g *GameObject) SetPosition2(x, y int32) {
g.position.X = x
g.position.Y = y
}

/*
physics type: Colliders and collisions[OFF]
*/
func (g *GameObject) SetPosition(pos Position) {
g.position = pos
}
Expand Down
3 changes: 0 additions & 3 deletions engine/physics.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,6 @@ func RayCast(idToIgnore int, initPos Position, dirreccion Position, long uint32,
ojb := _newGameObjectUnregister(initPos, NewSize(2, 2), SHAPE_RECTANGLE, idToIgnore)
for i = 0; i < long; i += uint32(jump) {
vectorPos := NewPosition(initPos.X+dirreccion.X+int32(i), initPos.Y+dirreccion.Y+int32(i))
//fmt.Println(vectorPos)
//if rl.CheckCollisionRecs(rl.NewRectangle(ConvertPosition(vectorPos).X,ConvertPosition(vectorPos).Y,))
//rl.DrawLine(initPos.X, initPos.Y, initPos.X+(int32(jump)*int32(long)), initPos.Y+(int32(jump)*int32(long)), rl.Brown)
if cp23 := ojb.collision.OnCollisionPos(vectorPos); cp23 != nil {
return cp23
}
Expand Down

0 comments on commit 9633c4c

Please sign in to comment.