Short and fun!

Share your ZGE-development tips and techniques here!

Moderator: Moderators

Post Reply
User avatar
rrTea
Posts: 378
Joined: Sat Feb 15, 2014 9:54 am

Short and fun!

Post by rrTea » Sat May 02, 2015 5:26 am

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!
Attachments
ZGE colorful lines 2a.gif
(scaled down)
ZGE colorful lines 2a.gif (554.17 KiB) Viewed 8012 times

Imerion
Posts: 197
Joined: Sun Feb 09, 2014 4:42 pm

Post by Imerion » Tue May 05, 2015 1:08 pm

Nice! Could indeed be fun to learn from and so.

User avatar
rrTea
Posts: 378
Joined: Sat Feb 15, 2014 9:54 am

Funny rainbow

Post by rrTea » Wed May 06, 2015 5:26 am

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)
Attachments
rainbow preview.jpg
Saturation depends on the cursor Y position.
rainbow preview.jpg (3.85 KiB) Viewed 7964 times
Last edited by rrTea on Sat May 09, 2015 8:59 am, edited 1 time in total.

User avatar
rrTea
Posts: 378
Joined: Sat Feb 15, 2014 9:54 am

Compass

Post by rrTea » Thu May 07, 2015 2:35 am

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
ZGE Compass.gif
Models rotate according to the mouse position.
ZGE Compass.gif (401.63 KiB) Viewed 7943 times

User avatar
rrTea
Posts: 378
Joined: Sat Feb 15, 2014 9:54 am

Post by rrTea » Sat May 09, 2015 8:25 am

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 :)
Attachments
ZGE Sprinkler3.gif
It loops!
ZGE Sprinkler3.gif (448.34 KiB) Viewed 7909 times

Imerion
Posts: 197
Joined: Sun Feb 09, 2014 4:42 pm

Post by Imerion » Sat May 09, 2015 11:33 pm

Nice effects! I'm interested in the compass one. Could you post the code for that?

User avatar
rrTea
Posts: 378
Joined: Sat Feb 15, 2014 9:54 am

Post by rrTea » Sun May 10, 2015 12:49 am

Here it is (->). Looking back at it... it's not very good. Still, it works so I like it.

User avatar
rrTea
Posts: 378
Joined: Sat Feb 15, 2014 9:54 am

"Congratulations Player one!"

Post by rrTea » Fri Jun 26, 2015 10:09 am

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.
Attachments
Happy message.gif
Change the material in OnRender to see different fonts!
Happy message.gif (234.93 KiB) Viewed 7770 times
Last edited by rrTea on Tue Oct 13, 2015 3:07 am, edited 1 time in total.

User avatar
VilleK
Site Admin
Posts: 2025
Joined: Mon Jan 15, 2007 4:50 pm
Location: Stockholm, Sweden
Contact:

Post by VilleK » Mon Jun 29, 2015 7:31 am

Always nice to see old Amiga fonts (although I was more of an Atari ST guy but those fonts appeared on both machines). :)

Post Reply