Skip to content

Commit 8418324

Browse files
committed
CX-games update
Update README with single cx . command to run games. Moved files in games directories so single cx . command can run games. Removed MakeFile from few games directories Fixed code for gltext.printf() function Fixed code for BrickBreaker game. Game runs, but there are issues with controls and visuals
1 parent 38763dd commit 8418324

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

52 files changed

+49
-306
lines changed

2DFWork/draw/text.cx

+1-1
Original file line numberDiff line numberDiff line change
@@ -99,5 +99,5 @@ func EntityAttachedText(x f32, y f32, offsetX f32, offsetY f32, s str) {
9999
// x & y are offsets
100100
func printTextWithColor (s str, x f32, y f32, color i32, alpha f32) {
101101
SetColorAndAlpha(color, alpha)
102-
gltext.Printf("Roboto100", f32.i32(x), f32.i32(y), s)
102+
gltext.Printf("Roboto100", x, y, s)
103103
}

2DFWork/menu/draw.cx

+2-2
Original file line numberDiff line numberDiff line change
@@ -77,8 +77,8 @@ func texts () {
7777

7878
gltext.Printf(
7979
Items[m][i].FontId,
80-
f32.i32(Items[m][i].Left),
81-
f32.i32(Items[m][i].Top),
80+
Items[m][i].Left,
81+
Items[m][i].Top,
8282
Items[m][i].Text)
8383
}
8484
}

2DFWork/mesh/draw.cx

+2-2
Original file line numberDiff line numberDiff line change
@@ -66,8 +66,8 @@ func DrawEditor () {
6666
draw.SetColor(draw.COLOR_CYAN)
6767
gltext.Printf(
6868
"Roboto58",
69-
space.ViewWidInPixels - w,
70-
0,
69+
i32.f32(space.ViewWidInPixels - w),
70+
0.0,
7171
name)
7272
}
7373
}

CXtris/Makefile

-2
This file was deleted.

CXtris/README-OLD.md

-20
This file was deleted.

CXtris/README.md

+6-12

CXtris/draw/controls.cx

+4-4
Original file line numberDiff line numberDiff line change
@@ -116,15 +116,15 @@ func drawKeyCapTexts () {
116116
// primary set
117117
gltext.Printf(
118118
keySetPri[i].FontId,
119-
f32.i32(keySetPri[i].Left),
120-
f32.i32(keySetPri[i].Top),
119+
keySetPri[i].Left,
120+
keySetPri[i].Top,
121121
keySetPri[i].Text)
122122

123123
// secondary set
124124
gltext.Printf(
125125
keySetSec[i].FontId,
126-
f32.i32(keySetSec[i].Left),
127-
f32.i32(keySetSec[i].Top - psSpan + keySetSec[i].Hei),
126+
keySetSec[i].Left,
127+
keySetSec[i].Top - psSpan + keySetSec[i].Hei,
128128
keySetSec[i].Text)
129129
}
130130
}

CXtris/draw/text.cx

+1-1
Original file line numberDiff line numberDiff line change
@@ -97,5 +97,5 @@ func scoreText () {
9797
var sY f32 = i32.f32(93) //app.START_HEIGHT)
9898
gl.LoadIdentity()
9999
gl.Color3f(1.0, 1.0, 1.0)
100-
gltext.Printf("Roboto28", f32.i32(sX), f32.i32(sY), shape.PlayerScoreTxt)
100+
gltext.Printf("Roboto28", sX, sY, shape.PlayerScoreTxt)
101101
}
File renamed without changes.
File renamed without changes.
File renamed without changes.

CXtris/game.cx CXtris/main/game.cx

File renamed without changes.

CXtris/main.cx CXtris/main/main.cx

File renamed without changes.

CXtris/menu.cx CXtris/main/menu.cx

File renamed without changes.
File renamed without changes.

CXtris/time.cx CXtris/main/time.cx

File renamed without changes.

CXtris/run.bat

-13
This file was deleted.

aground-cx/internal/scene/crafting-scene.cx

+2-2
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,8 @@ func NewCraftingFrontScreen(screen_width i32, screen_height i32) (screen screen_
5656
button_pkg.newButton(
5757
"craft-button",
5858
0.0, -0.75, 240, 70,
59-
"static/texture/btn/select-button-inactive.png",
60-
"static/texture/btn/select-button-active.png"))
59+
"./static/texture/btn/select-button-inactive.png",
60+
"./static/texture/btn/select-button-active.png"))
6161

6262
screen = screen.addLayer(crafting_layer)
6363
}

aground-cx/pkg/graphical3d/triangleGeometry.cx

+12-7
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,17 @@ type TriangleGeometry struct {
1010
material Material
1111
}
1212

13-
func newTriangleGeometry(vertice1 Vector3f, vertice2 Vector3f, vertice3 Vector3f, material Material) (tg) {
14-
tg = TriangleGeometry{
15-
position:newVector3f(0.0, 0.0, 0.0),
16-
vertices:[3]Vector3f{vertice1, vertice2, vertice3},
17-
rotation:newVector3f(0.0, 0.0, 0.0),
18-
material:material}
13+
func newTriangleGeometry(vertice1 Vector3f, vertice2 Vector3f, vertice3 Vector3f, material Material) (tg TriangleGeometry) {
14+
var vec [3]Vector3f
15+
vec[0] = vertice1
16+
vec[1] = vertice2
17+
vec[2] = vertice3
18+
19+
tg.position = newVector3f(0.0, 0.0, 0.0)
20+
tg.vertices = vec
21+
tg.rotation = newVector3f(0.0, 0.0, 0.0)
22+
tg.material = material
23+
1924
return tg
2025
}
2126

@@ -28,7 +33,7 @@ func (tg TriangleGeometry) render () {
2833

2934

3035
// TODO fix texture mapping
31-
if pg.material.textured {
36+
if tg.material.textured {
3237
gl.BindTexture(gl.TEXTURE_2D, tg.material.texture)
3338

3439
gl.Begin(gl.QUADS);

brick-breaker/Makefile

-21
This file was deleted.

brick-breaker/README.md

+1-1

brick-breaker/pkg/graphical3d/triangleGeometry.cx brick-breaker/_pkg/graphical3d/triangleGeometry.cx

+12-7
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,17 @@ type TriangleGeometry struct {
1010
material Material
1111
}
1212

13-
func newTriangleGeometry(vertice1 Vector3f, vertice2 Vector3f, vertice3 Vector3f, material Material) (tg) {
14-
tg = TriangleGeometry{
15-
position:newVector3f(0.0, 0.0, 0.0),
16-
vertices:[3]Vector3f{vertice1, vertice2, vertice3},
17-
rotation:newVector3f(0.0, 0.0, 0.0),
18-
material:material}
13+
func newTriangleGeometry(vertice1 Vector3f, vertice2 Vector3f, vertice3 Vector3f, material Material) (tg TriangleGeometry) {
14+
var vec [3]Vector3f
15+
vec[0] = vertice1
16+
vec[1] = vertice2
17+
vec[2] = vertice3
18+
19+
tg.position = newVector3f(0.0, 0.0, 0.0)
20+
tg.vertices = vec
21+
tg.rotation = newVector3f(0.0, 0.0, 0.0)
22+
tg.material = material
23+
1924
return tg
2025
}
2126

@@ -28,7 +33,7 @@ func (tg TriangleGeometry) render () {
2833

2934

3035
// TODO fix texture mapping
31-
if pg.material.textured {
36+
if tg.material.textured {
3237
gl.BindTexture(gl.TEXTURE_2D, tg.material.texture)
3338

3439
gl.Begin(gl.QUADS);
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

contest-elim/Makefile

-5
This file was deleted.

contest-elim/README.md

+1-3

issues/136/136.cx

-6
This file was deleted.

issues/136/pkg.cx

-5
This file was deleted.

issues/165.cx

-25
This file was deleted.

issues/166.cx

-8
This file was deleted.

issues/167.cx

-9
This file was deleted.

issues/168.cx

-5
This file was deleted.

issues/169.cx

-11
This file was deleted.

issues/170.cx

-19
This file was deleted.

issues/171.cx

-10
This file was deleted.

issues/172.cx

-12
This file was deleted.

issues/173.cx

-12
This file was deleted.

0 commit comments

Comments
 (0)