Sega Saturn Development > Project announcement

Project Blaze

<< < (2/5) > >>

NeoSnk:
Hey guys, I'm creating some effects like rain, snow and others. Maybe it could be useful for you, so, I'm sharing my files.

Video: https://youtu.be/ZQ4BTkI4BzE
File is attached.

NeoSnk:
Effect:Snow
Video:https://youtu.be/59b1qpXXP6w
File:Attached.

NeoSnk:
Johannes maybe you could create a section for this,then people could collaborate with their codes!!!

mindslight:
Sure,

I created a section called "Share your code".

BTW, Nice effects :)

Chron:
I like how that rain looks, nice job.  Snow is a bit jittery, but still good.

If I may make some comments on your code:
You've got a lot of "magic numbers" in multiple places, which are constant literals (100, 160, etc) that would make your code more readable and easier to maintain as either constant variables or compiler definitions.

A simple example, from your code:

--- Code: ---
int drops = 100;
int save_y[100];
int save_x[100];
int save_speed[100];

--- End code ---

It could be easier to do it like this:

--- Code: ---
const int DROPS = 100;
int save_y[DROPS];
int save_x[DROPS];
int save_speed[DROPS];

--- End code ---

#define DROPS 100
is also a way to do this thing.

Then any place you have code which depends on the number of drops you don't have to remember to change, you just change the value of the constant or the compiler macro; saves a lot of headache with larger programs.

You may also want to consider using an array of structures to keep track of the data you have in separate arrays.

Apologies if you already know this stuff, I just felt like pointing it out.

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Sitemap 1 2 3 4 5 6 7 8 9 10 
Go to full version