Jul/100
Temporary Post Used For Theme Detection (7c965c9a-16ac-420b-a659-33ef4b1b854f - 3bfe001a-32de-4114-a6b4-4005b770f6d7)
This post is syndicated from Office Comics.
This is a temporary post that was not deleted. Please delete this manually. (677e69ba-36bd-47db-84e3-78862fb14ac7 - 3bfe001a-32de-4114-a6b4-4005b770f6d7)...(read more)Jul/100
How it’s Made: Tower Defense - a Game in Excel 2010
This post is syndicated from Microsoft Excel 2010.
This blog post is brought to you by Karen Cheng a Program Manager on the Excel team.
In today's post, we'll show you how the arcade game Tower Defense was created in an Excel spreadsheet (see a video of the game being played here). In this game, creeps move toward your castle. You must defend it by placing towers which shoot at the creeps. The more creeps you kill, the more money you get to buy and upgrade your towers.
To play, you'll need -
· To download the game here.
· To install Excel 2010, hot off the press last week. You can get a free trial here. The games use features that are new to Excel 2010, so they won't work in older versions.
When you open the file to play, don't forget to enable the macros. Also, if you get a circular reference warning, you need to enable iterative calc by setting “Enable iterative Calculation” in advanced options under File -> Options -> Formulas -> Enable Iterative Calculations.
Instructions and General Gameplay
After selecting your level and difficulty and clicking Play, the game begins.
Creeps - Creeps come in "waves" of four. Each wave, they get stronger - They require stronger bullets to kill (strength), move faster (speed), and reward you with more cash once killed (worth). These stats are under the Creeps part of the menu.
Towers - To buy a tower, click on one of the towers on the right and then click on the map to place it. Towers come in two varieties - Basic and Advanced. Advanced towers are basically supercharged versions of the basic towers that shoot stronger bullets (Strength), faster bullets (Speed), and bullets that travel farther (Range). Clicking on a tower will show you these stats. Since a tower can only fire one bullet at a time, hitting the creeps at a closer range lets the tower shoot more bullets before the creep gets too far away. Range is shown by a heat map around the tower.
When you earn enough cash, you can upgrade your towers, which will increase their stats. Upgraded towers are represented by blue shading.
Lives - If a creep reaches your castle (which is represented by the flag), you lose a life. You get three lives.
The Graphics Engine
Play the game and you'll notice the animation of the creeps and bullets. You wouldn't be able to achieve this level of smooth animation if each cell simply represented a pixel, as in Missile Command. So how was this done?
Creeps and Bullets
The secret lies in a transparent scatter chart (two charts, technically, but that's more detail than we'll get into) that lays on top of the game screen. The creeps and bullets are points on the scatter plot, which constantly recalculates and refreshes. The bullets are represented by one series on the chart (the Xs) and the creeps are represented by a second series (the red diamonds).
The X-Y coordinates of the creeps and bullets are calculated via linear interpolation based on a number of factors (the map path, the location of the castle, and game's clock).
I won't go specifically into what each of these columns mean, but here's a peek into some of the stats used to calculate the position of the creeps. They are on the hidden worksheet, Calc.
Map Path, Towers, and Castles
The map path, towers, and castles are all drawn on the grid with conditional formatting. Below I've overlaid an image of the numbers behind the cells with the game area. Below you can see that -1 represents the map path, -23 is a basic tower with two upgrades, etc. These numbers are constantly being recalculated as you play the game.
The conditional formatting rules behind the grid
In Excel 2010, we've expanded your capability to create intricate and complex rules by allowing formula-based conditional formatting to reference other worksheets. Behind each cell is a formula that looks something like this:
=IF(Calc!B263<>0,Calc!B263,IF(AND('Fixed Data'!AE2=Calc!$D$6,'Fixed Data'!AE16=Calc!$C$5),0,('Fixed Data'!AE2-Calc!$D$46)^2+('Fixed Data'!AE16-Calc!$D$45)^2))
While we won't go into what every piece of that formula does, we do want to draw attention to the references to two hidden worksheets, Fixed Data and Calc - cross-sheet references made possible in Excel 2010. If you're curious, unhide the sheets and check out the formulas behind the cells. The ones that generate the heat map of tower strength on mouse hover are the most interesting. Finally putting that Pythagorean Theorem you learned back in grade school to good use!
Bells and Whistles
Sparklines
When you play the game, you'll notice an animated line at the bottom, which displays the frame rate of the game. This is done with sparklines, a new feature in Excel 2010 that allows you to embed mini charts in a cell.
While sparklines weren't exactly designed to be animated, they can be animated with some clever spreadsheet engineering. The sparkline is based on a data range (Calc worksheet, C56:C85) which is constantly recalculated, creating the illusion of movement.
Slicers
Did you notice that when you chose the level and difficulty at the beginning of the game, you didn't have to go to a dropdown to do it? Instead you clicked on buttons in slicers, a new feature in Excel 2010 that allows you to quickly and visually interact with your data.
Oh, and of course - no game would be legitimate without being available in multiple languages.
A final note
One cool thing about this spreadsheet is how little macros were used. For the most part, macros are only being used to start/stop the game and keep track of mouse movements and clicks. Everything else is pure Excel: the calculation engine, conditional formatting, and two new features to Excel 2010 - sparklines and slicers.
Jul/100
Quick Rule Creation in Outlook 2010
This post is syndicated from Microsoft Outlook 2010.
If you are a heavy email user like me, chances are good that you subscribe to a lot of mailing lists. Unsolicited spam is one issue we battle in our inboxes, but perhaps more perplexing is the amount of email messages that we call “graymail.”
Graymail consists of all those newsletters, coupons, and notifications that can sometimes be useful, but aren’t the things that you want to appear at the top of your Inbox. For example, some of the graymail I regularly receive includes notifications from Netflix, sale flyers from a local outdoors retailer, and email from a food and wine discussion group.
I like to see what movie Netflix has shipped to me, or what is on sale at my favorite stores, but since these messages aren’t time-sensitive and I don’t need to reply, I don’t want them to appear in my Inbox. I would rather move the messages to a folder where I can browse them later.
Outlook 2010 makes it easy for me to sort emails that need attention from graymail. For example, when I received a shipping notification from Netflix, on the ribbon I went to the Home tab and then clicked Rules. Then I clicked Always Move Messages from: Netflix. The sender was suggested based on the message sender and recipients (if it was sent to people other than you).
For a destination folder, I selected my Notifications and Alerts folder so that all of my current and future messages from Netflix would go to that folder. I did the same thing for other companies that regularly send me messages about sales and events that I am interested in.
Now, I’ll never see another Netflix notification in my Inbox, but they are always available in my Notification and Alerts folder that I review at my convenience every day or two.
When I sign up for a new mailing list such as the Food and Wine list I am on I use this “Always Move” command to quickly create a rule that moves messages sent to that mailing list to a new folder I make specifically for those emails.
I hope this simple way to create rules helps you take control of your Inbox by moving graymail messages into their own folders and keeping only the most important messages in your Inbox.
Josh Meisels
Outlook Program Manager
Jul/100
Announcing Excel 2010 Developer Challenge Winners
This post is syndicated from Microsoft Excel 2010.
We want to thank all of you who submitted entries for our Excel challenge. We had great entries that were well designed using Excel 2010 features, VBA and the user interface. Many of you are as passionate about Excel as we are and we thank you for your feedback.
We extend our congratulations to the following winners:
|
First Prize Winner: Andre L G Viol, United States
Prize: Xbox 360 Elite Video Game Entertainment System and a copy of the Xbox 360 game: FIFA 2010 Description of the application: The application enables user to keep track of the results of the 2010 World Cup from beginning to end. It has a calendar of the games, a graphical description of the groups in which the teams are divided, the complete table of matches for both the group and knockout stages, a page with some basic statistics so the user can visually see the performance of the teams compared to each other, a summary of the data that includes data from all previous world cups and some options to choose from and charts comparing wins, draws, losses, goals and some stats for all teams that have at least one participation in a World Cup. The user is able to retrieve the results of all matches via internet, by pressing a button. Note: Click here to download the winning application. |
|
Second Prize Winner: Premysl Lazecky, Czech Republic Prize: National team jersey of winner’s choice Description of the application: User fills all data about each match or the application can download the data from the FIFA website. User is able to see statistic of each team or players – who scored, who got yellow or red card, who played a match. Also there is a nice database about previous world champions cups. The application customizes the ribbon with a new tab and buttons. |
In addition, we would like to have special mention to the following participants for their outstanding Excel 2010 applications. The following will receive “I love Macros” t-shirts:
· Elliot Bendoly United States
· Louise Sondergaard Denmark
· Grid Logic United States
· Adrian Wibly Argentina
· Ji Fang China
· Juan P Arbelaez R Colombia
To learn more about how to develop on Office 2010, go to Office Developer Center.
Jul/100
Vote for the prototype you like for the Open XML SDK
This post is syndicated from Microsoft Excel 2010.
The developer documentation team is asking for your feedback on a couple prototypes for the Open XML SDK Documentation. Visit their blog to download the prototypes and vote:
Jul/100
How it’s Made: Missile Command - a Game in Excel 2010
This post is syndicated from Microsoft Excel 2010.
This blog post is brought to you by Karen Cheng a Program Manager on the Excel team.
In today's post, we'll show you how the classic arcade game Missile Command was created in an Excel spreadsheet. We also explain how it's made in this video. In this game, missiles drop from the sky, attacking the city. You must click on the missiles to destroy them.
To play, you'll need -
· To download the game (here)
· To install Excel 2010, hot off the press last week. You can get a free trial here. The games use features that are new to Excel 2010, so they won't work in older versions.
When you open the file to play, don't forget to enable the macros.
The Graphics Engine
The "graphics engine" is made entirely with conditional formatting. Each cell, which represents a pixel, has a number in between 1-10 to represent a shade of grey.
You can't actually see the numbers because the cells have been shrunken down, but enlarge the cells a bit and you'll see the numbers behind the "pixels":
The numbers behind the graphics engine
The entire game runs from a macro that is triggered by clicking on Start. The macro constantly recalculates what numbers to populate the grid with.
Calculating Missile Paths
Each missile runs through this series of calculations:
1. The starting point for the missile is chosen to be somewhere at random at the top of the screen
2. Each missile will at random choose one of the remaining standing buildings to target. It chooses one cell in the general perimeter of the building
3. Based on the starting and ending cell, the slope of the path the missile is calculated, such that it travels at the correct X to Y (column to row) ratio
4. The macro then repopulates the cells in the path over and over again in a loop to "draw" the missile path
5. If the missile hits the building, the game notes which building has been destroyed. The cells around the building are redrawn to the "destroyed building" state and the missile is removed.
Destroying the Missiles
Missiles are destroyed by clicking and creating a shield, which looks like an explosion effect. If the shield and missile collide, the missile is destroyed.
1. To detect the gamer's click, the macro detects when the cell selection changes. If the new cell selection is within the playable game area, the shield is drawn.
2. To draw the shield, the macro quickly draws and redraws six frames in sequence
The shield explosion effect, frame by frame.
3. If any part of the shield and missile occupy the same cell, the missile's path is aborted and the missile is destroyed. If any part of the shield occupies a cell occupied by a standing building, that building is destroyed.
General Gameplay
When a missile is destroyed, another one is instantly created. The number of missiles on the screen at any given time corresponds to the level. So at level 5, there will be 5 missiles on the screen at once.
The progress bar indicating how far the gamer is along a level is value in a cell formatted by a data bar.
The level progress indicator
Formatted by data bars
One more thing - you can peek behind the code (and hack away to your heart's desire) by pressing Alt-F8 and clicking edit.
The code behind the scenes
Thanks for tuning into this episode of How It's Made. In the next edition, we'll show you how the classic arcade game Tower Defense is made in Excel.
