Here are some experiments I composed while either researching various ZGE features or during lunch breaks etc. Nothing spectacular (neither artistically nor technically) but maybe it'll be of interest to non-programmers new to ZGE (like me). I think there can never be enough of fun snippets to study - and I'd like to see others post theirs in this thread!
So the first one just draws colorful lines on the screen, that's it!
Here is the code on Pastebin. If anybody sees some glaring mistakes... I'd like to know if it can be done in a simpler / better way!
Short and fun!
Moderator: Moderators
Short and fun!
- Attachments
-
- (scaled down)
- ZGE colorful lines 2a.gif (554.17 KiB) Viewed 35219 times
Funny rainbow
This one draws a rainbow that reacts to mouse position. I actually saw someone do something like this in some other programing language and thought it'd be fun (and easier probably) to make it in ZGE. Change the "NumberOfBars" constant for different number of Rainbow fields!
There's even some plink plonky sound so don't forget to turn the sound on!
Uses Kjell's HSV library (see here for the current version, which is also used in this example).
(Code on Pastebin)
There's even some plink plonky sound so don't forget to turn the sound on!
Uses Kjell's HSV library (see here for the current version, which is also used in this example).
(Code on Pastebin)
- Attachments
-
- Saturation depends on the cursor Y position.
- rainbow preview.jpg (3.85 KiB) Viewed 35171 times
Last edited by rrTea on Sat May 09, 2015 8:59 am, edited 1 time in total.
Compass
Here's an old one! I think this one was written while I was studying the relationship between the mouse position and the screen? It's pretty awkward (I'd do it differently if I were to write it now) but works.
- Attachments
-
- Models rotate according to the mouse position.
- ZGE Compass.gif (401.63 KiB) Viewed 35150 times
Another one imitating something similar I saw somewhere. Here the effect is achieved by spawning Models - considering it's just a few tens of them it doesn't have any serious effect on framerate, but if it were part of a bigger project (a game or something) I'd probably try to do it with particles instead.
Alright I guess it's time to stop constantly bumping this thread for now![Smile :)](./images/smilies/icon_smile.gif)
Alright I guess it's time to stop constantly bumping this thread for now
![Smile :)](./images/smilies/icon_smile.gif)
- Attachments
-
- It loops!
- ZGE Sprinkler3.gif (448.34 KiB) Viewed 35116 times
"Congratulations Player one!"
A simple effect for animating text. I always forget the exact numbers to achieve this effect so here goes! (code on hastebin)
Uses Amiga fonts from Daniel's collection.
Uses Amiga fonts from Daniel's collection.
- Attachments
-
- Change the material in OnRender to see different fonts!
- Happy message.gif (234.93 KiB) Viewed 34977 times
Last edited by rrTea on Tue Oct 13, 2015 3:07 am, edited 1 time in total.