Tetris game by Igor Pro

A Tetris game by Igor Pro. All  basic functions of a tetris game are realized such as  automatic level upgrade.

Now you can have a try and see how many points can you get?

I can get about 7000:)

 

Some things you my be intersted at:

1 The tetris panel and blocks are simulated with a matrix and a curve. 

2 The shape and movement of blocks are simulated both by an extra color wave and customolized markers. 

3 Igor behaves really amazing: the graph window can always immediately respond to background data changes( the matrix size is 10x20,the curve is also 200 length) without any delay. 

 

A small problem:

If I play a action sound(such as the sound when you clear one line of tetris), the background music have to be stopped. The PlaySound command can only play one sound at one time. Currently I dont find any way to work around this problem.

Images:

Tetris playfiled

Project Details

Current Project Release

Release File: tetris5 .pxp (2.95 MB)
Version Date:
OS Compatibility: Windows
View All Releases

Needs 2 changes:

Function ButtonProc(ctrlName) : ButtonControl
    String ctrlName
    Button $ctrlName, disable=2 // so that the space key doesn't restart the game
    startgame()
End

Function endgame()
    ctrlNamedBackground task1,proc=RunningGame,stop
    ctrlNamedBackground task2,proc=playbg,stop
    wave bg0
    Playsound/A=2 bg0
    Button button0, disable=0 // allow restarting the game
End

In reply to by thomas_braun

After starting, the input focus is on the start button.

So a mouse click at the playfiled is needed to redirect the it to  the graph window.

This is of course not "good"!

I thought to put the button on a panel bar and use SetActiveSubWindow to avoid this problem... yet not have implemented.

Apparently JimProuty's method is better. I have updated it acordingly.

Forum

Support

Gallery

Igor Pro 9

Learn More

Igor XOP Toolkit

Learn More

Igor NIDAQ Tools MX

Learn More