Short and fun!

Share your ZGE-development tips and techniques here!

Moderator: Moderators

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

Short and fun!

Post by rrTea »

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
(scaled down)
(scaled down)
ZGE colorful lines 2a.gif (554.17 KiB) Viewed 38661 times
Imerion
Posts: 200
Joined: Sun Feb 09, 2014 4:42 pm

Post by Imerion »

Nice! Could indeed be fun to learn from and so.
User avatar
rrTea
Posts: 475
Joined: Sat Feb 15, 2014 9:54 am

Funny rainbow

Post by rrTea »

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
Saturation depends on the cursor Y position.
Saturation depends on the cursor Y position.
rainbow preview.jpg (3.85 KiB) Viewed 38613 times
Last edited by rrTea on Sat May 09, 2015 8:59 am, edited 1 time in total.
User avatar
rrTea
Posts: 475
Joined: Sat Feb 15, 2014 9:54 am

Compass

Post by rrTea »

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.
Models rotate according to the mouse position.
ZGE Compass.gif (401.63 KiB) Viewed 38592 times
User avatar
rrTea
Posts: 475
Joined: Sat Feb 15, 2014 9:54 am

Post by rrTea »

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
It loops!
It loops!
ZGE Sprinkler3.gif (448.34 KiB) Viewed 38558 times
Imerion
Posts: 200
Joined: Sun Feb 09, 2014 4:42 pm

Post by Imerion »

Nice effects! I'm interested in the compass one. Could you post the code for that?
User avatar
rrTea
Posts: 475
Joined: Sat Feb 15, 2014 9:54 am

Post by rrTea »

Here it is (->). Looking back at it... it's not very good. Still, it works so I like it.
User avatar
rrTea
Posts: 475
Joined: Sat Feb 15, 2014 9:54 am

"Congratulations Player one!"

Post by rrTea »

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
Change the material in OnRender to see different fonts!
Change the material in OnRender to see different fonts!
Happy message.gif (234.93 KiB) Viewed 38419 times
Last edited by rrTea on Tue Oct 13, 2015 3:07 am, edited 1 time in total.
User avatar
VilleK
Site Admin
Posts: 2320
Joined: Mon Jan 15, 2007 4:50 pm
Location: Stockholm, Sweden
Contact:

Post by VilleK »

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