summaryrefslogtreecommitdiffhomepage
path: root/samples/99_genre_3d/3d_cube
diff options
context:
space:
mode:
author_Tradam <[email protected]>2021-12-16 19:22:26 -0500
committerGitHub <[email protected]>2021-12-16 19:22:26 -0500
commit5954b9beb4d4a3b4f248d72d1851195f030558a8 (patch)
treefecd8aa840a25afdb502915b0fdb4d03b7ed339a /samples/99_genre_3d/3d_cube
parent2f845281f133849256b57bb08fd3e9ae57600784 (diff)
parenteaa29e72939f5edf61735ccbb73c36ee89369f65 (diff)
downloaddragonruby-game-toolkit-contrib-master.tar.gz
dragonruby-game-toolkit-contrib-master.zip
Merge branch 'DragonRuby:master' into masterHEADmaster
Diffstat (limited to 'samples/99_genre_3d/3d_cube')
-rw-r--r--samples/99_genre_3d/3d_cube/app/main.rb50
-rw-r--r--samples/99_genre_3d/3d_cube/sprites/square-blue.pngbin283 -> 0 bytes
2 files changed, 0 insertions, 50 deletions
diff --git a/samples/99_genre_3d/3d_cube/app/main.rb b/samples/99_genre_3d/3d_cube/app/main.rb
deleted file mode 100644
index fc95291..0000000
--- a/samples/99_genre_3d/3d_cube/app/main.rb
+++ /dev/null
@@ -1,50 +0,0 @@
-STARTX = 0.0
-STARTY = 0.0
-ENDY = 20.0
-ENDX = 20.0
-SPINPOINT = 10
-SPINDURATION = 400
-POINTSIZE = 8
-BOXDEPTH = 40
-YAW = 1
-DISTANCE = 10
-
-def tick args
- args.outputs.background_color = [0, 0, 0]
- a = Math.sin(args.state.tick_count / SPINDURATION) * Math.tan(args.state.tick_count / SPINDURATION)
- s = Math.sin(a)
- c = Math.cos(a)
- x = STARTX
- y = STARTY
- offset_x = (1280 - (ENDX - STARTX)) / 2
- offset_y = (360 - (ENDY - STARTY)) / 2
-
- srand(1)
- while y < ENDY do
- while x < ENDX do
- if (y == STARTY ||
- y == (ENDY / 0.5) * 2 ||
- y == (ENDY / 0.5) * 2 + 0.5 ||
- y == ENDY - 0.5 ||
- x == STARTX ||
- x == ENDX - 0.5)
- z = rand(BOXDEPTH)
- z *= Math.sin(a / 2)
- x -= SPINPOINT
- u = (x * c) - (z * s)
- v = (x * s) + (z * c)
- k = DISTANCE.fdiv(100) + (v / 500 * YAW)
- u = u / k
- v = y / k
- w = POINTSIZE / 10 / k
- args.outputs.sprites << { x: offset_x + u - w, y: offset_y + v - w, w: w, h: w, path: 'sprites/square-blue.png'}
- x += SPINPOINT
- end
- x += 0.5
- end
- y += 0.5
- x = STARTX
- end
-end
-
-$gtk.reset
diff --git a/samples/99_genre_3d/3d_cube/sprites/square-blue.png b/samples/99_genre_3d/3d_cube/sprites/square-blue.png
deleted file mode 100644
index b840849..0000000
--- a/samples/99_genre_3d/3d_cube/sprites/square-blue.png
+++ /dev/null
Binary files differ