Snowing Effect in Monkey X

Since Christmas is coming soon, I decided to share my snowing effect code I wrote last year. The original code was written in BlitzMax. This year I have already made new Christmas intro in Monkey X. You may want to take look at the snowing effect of the Christmas video of the last year.

Examine the code and you’ll get the idea quickly. Implementation in other programming languages should be quit straight forward. Just use background picture of your own.

Feel free to use the code.

If the featured image doesn’t show up, below is a screenshot of the program:

I will soon publish my new Merry Christmas 2017 and Happy New Year 2018 video. And… It’s also written in Monkey X.

What if Smart Screen blocks my product?

What if Smart Screen prevents my product to run on your computer? You can check the file before running it with some antivirus scanner and as you see, that there’s nothing harmful, just run the program. See the video (I have Finnish system, but I have added needed translations):

My system is protected by F-Secure’s protection package. If you have F-Secure’s protection too, and Deep Guard says it has prevented harmful program to run (in Finnish: ”Deep Guard on estänyt haitallisen tiedoston”), you may still do the same scanning as shown in the video and as you see, that the program is actually clean, don’t be afraid of running it.

Though, if the Deep Guard prevents the program to run, one must manually allow the Deep Guard to run the program, by changing F-Secure’s AV settings in order to put the program to the list of allowed programs.

In case you ran into any problems, just contact me by e-mail and we’ll find a solution together.

Image courtesy of TAW4 at FreeDigitalPhotos.net

In order to prevent the Smart Screen to block a program one should have a certificate and put the certificate into one’s program after one has validated it with Microsoft’s validator. But the certificate is expensive…

Also, many of you may have noticed that one somekind of generic interpretation of a “virus” or some harmful file is often just a rare file, rare piece of software nowadays… The definition of rare is sometimes just new.

Unique Random Integers part II

Last year I wrote about my clumsy implementation of unique random integers system, I’ve used in my Memorable Ladies games. In those the speed isn’t a critical factor. It’s sufficient that the idea works. 🙂

In this post the idea behind unique random integers is the same, but implemented in a faster way.

In the implementation I have used an array that consists of all desired integers and each is drawn in a way that the same integer doesn’t get drawn again. Let’s take a look at the code (I have used Monkey2 programming language in the example):

Image courtesy of nonicknamephoto at FreeDigitalPhotos.net

First an array is initialized with desired integers. Then an random integer from the array is fetched using random index inside the array.  After that the numbers after the drawn number are moved to “left”. For the end the amount of integers is decreased by 1 and the array is resized by the new amount of integers. That’s it.

This way one gets always different random integer from the set of desired integers.

Furthermore, if one would like to get, for example, number four (4) to be drawn three times, one could just include 4 three times in the array.

Depending on what one is doing, one could keep a copy of the original array for future usage.

Although I have used Monkey2 as example programming language, it should be easy to implement similar implementation to many other programming languages quite straight forwardly.