Javascript

Javascript Animation Engine

Javascript Animation Engine

This is a small animation engine I made to handle an animation that a good friend of mine created in 3D Max and exported to images. This should have been made in Flash for any serious use, but for a quick experiment and FPS testing it worked out fine.

Read more…

IE7 and onclick events

IE7 and onclick events

The onclick event is getting more used than ever before these days as AJAX is becoming increasingly used for interactive web site functions. But there is a problem sometimes when using it with IE7.

An onclick event will work perfectly in Firefox, but when you try in Internet Explorer 7 (and maybe 6) it will seemingly bug out without any error or warnings at all.

Read more…

KiKi Trix – A Tetris Clone

KiKi Trix – A Tetris Clone

A tetris clone. Tested OK in FF2 and IE7. Programming a tetris game is a fun challenge. A basic tetris clone covers many real-time gaming mechanics that can be used outside the gaming genre as well for other types of applications.
Read more…

3D Rotation Trig

3D Rotation Trig

I started off easy with a simple simulated z-axis rotation in a 2D script. However 2D is not 3D which is what I wanted to learn. I was eager to get a better grasp on the underlying trigonometry math of 3D rotation behavior.

Read more…

2D Rotation Trig

2D Rotation Trig

I made this little script to play with sine and cosine to perform a 2D rotation. These are trigonometric functions to measure the ratio between the hypotenuse and the adjacent, or opposed line from θ. sine and cosine can be calculated in 2 ways, either dividing lines with hypotenuse, or through feeding a calculating function the θ.

Read more…

The ternary operator and If/Else

The ternary operator and If/Else

The ternary operator “:?” to make If/Else structures smaller and compact is a beautiful thing. Evaluate the following example and how it could be written in a much more compact and faster way. You can use this technique in several languages. I have personally used it during PHP and Javascript quite often.

Read more…

AJAX basics in javascript

AJAX basics in javascript

Illustrates the use of AJAX (Asynchronous JavaScript And XML). It involves a javascript function, third-party file saved on the server side to get data from, and a call being made to it from the client side without refreshing the browser – this is the main concept of AJAX.

Read more…