Showing posts with label Flash. Show all posts
Showing posts with label Flash. Show all posts

Friday, October 24, 2008

Fantistic Contraption...When Physics can be Fun!!!

While skimming through various blogs, I came across a very interesting post on the How-to Geek. The post was about yet another online flash game, but this time it is based on physics and puzzle solving, so I thought I'd give it a try.

Fantastic Contraption turned out to be an extremely fun game to play. The objective of the game is to move the red object (usually a circular object, but sometimes other shapes) to the red area (called the "goal"). Sometimes there are some obstacles in the way. To achieve the goal, you have to build a "contraption" using the tools at the top of the screen, and use this contraption to move the red object to the goal area. To make things even harder, you can only build your contraption within the light blue area (the workshop).



The games with a large number of levels, each of which has a different arrangement of objects. One good thing about this game is that you don't have to proceed through the level sequentially. If you find yourself stuck at a particular level, you can go to the main menu, and play a different level of your choosing.

You can also save your contraptions (in mid-level, or after you've solved the level), but you have to create an account in order to do this (which is free). You will be given a link that you can share with others so they can directly see your contraption in action. You can also upload your contraptions to the server. Once you solve a level, you can view contraptions built by other users for that particular level. Here are some of the contraptions I've built (A, B, C, D, E, F, G, H, I, J, K, L, M, N, O). I am not listing them in level order, or even including the level, so that I don't spoil your experience with the game.

Warning: The game is very addictive, so make sure you don't lose track of time while playing it.
Have fun!!

Tuesday, January 29, 2008

Actionscript 3: Strict-Mode Versus Standard-Mode Compilation

ActionScript offers two different modes for compiling a program: strict mode and standard mode. In strict mode, the compiler reports more errors than in standard mode. The extra strict-mode errors are intended to help programmers locate potential sources of problems in a program before the program actually runs. Strict mode is, therefore, enabled by default in all of Adobe's compilers. Programmers who wish to use ActionScript's dynamic features, or who simply prefer to solve problems (i.e., debug) at runtime rather than at compile time can choose to compile using standard mode.

The following questionable acts of programming will cause a compiler error in strict mode, but not in standard mode:

  • *Supplying the wrong number or types of parameters to a function

  • *Defining two variables or methods with the same name

  • *Accessing methods and variables that are not defined at compile time (but might be defined at runtime using the dynamic features techniques)

  • *Assigning a value to a nonexistent instance variable of an object whose class is not dynamic

  • *Assigning a value to a constant variable anywhere other than the variable's initializer or, for instance variables, the constructor method of the class containing the variable's definition

  • *Attempting to delete (via the delete operator) an instance method, instance variable, static method, or static variable

  • *Comparing two incompatibly typed expressions

  • *Assigning a value to a type-annotated variable where the value is not a member of the declared type (some exceptions to this rule exist, see the special cases of Strict Mode below)

  • *Referring to nonexistent packages


Strict Mode's Three Special Cases

There are three situations in which the compiler ignores type mismatch errors in strict mode, deferring possible type errors until runtime:

  • *When an untyped expression is assigned to a typed variable or parameter, or returned from a function with a declared return type

  • *When any expression is assigned to a typed variable or parameter whose declared type is Boolean, or returned from a function whose declared return type is Boolean

  • *When any numeric value is used where an instance of a different numeric type is expected