Tutorial 4: Make a Game in 60 Minutes This tutorial helps you learn about the process of game construction, while guiding you through writing a relatively complete game. The code in this tutorial illustrates the technique described in the text. A complete code sample for this tutorial is available for you to download, including full source code and any additional supporting files required by the sample. Understanding the basics of game coding is the single most-difficult step for a beginning game programmer. Think of the idea of your ship on the screen. If, for instance, you wanted to add a second ship that would also draw on the screen, and had the ability to move and turn, you would have to create a copy of each of the variables you were using for the first ship. For a game that will ultimately have more than a dozen objects all drawing and moving around, this is unworkable. Start by right-clicking on your project in Solution Explorer, and select Add, then Class. Start with drawing the ship's model. Figure 1. Figure 2.
JavaScript 101, Beginner's Guide to Learning Block / Inline JavaScript JavaScript is a programming language that web browsers understand. You can use it to make your web pages interactive by: Responding to user actions and changes on the pageManipulating the web page’s contents and behaviourCommunicating with the user directly You can do just about anything you want with a web page, using JavaScript. In this introductory tutorial and the series to follow, I’ll introduce the JavaScript language and how to write it, through a series of practical worked examples. Example 1: Hello World! “Hello World!” What we want to do When the user clicks a button, show the message, “Hello World!”. Step 1: Create a button Our web page needs a button to click: Let’s explain the various bits of the HTML: Try clicking the button… Did anything happen? This is exactly right, because we haven’t told the page that anything should happen when the button is clicked. Making something happen with inline JavaScript The easiest way is to write what we want to happen into the button tag itself.
The Shapes of CSS Learn Development at Frontend Masters CSS is capable of making all sorts of shapes. Squares and rectangles are easy, as they are the natural shapes of the web. Add a width and height and you have the exact size rectangle you need. Add border-radius and you can round that shape, and enough of it you can turn those rectangles into circles and ovals. We also get the ::before and ::after pseudo elements in CSS, which give us the potential of two more shapes we can add to the original element. Square Rectangle Circle Oval Triangle Up Triangle Down Triangle Left Triangle Right Triangle Top Left Triangle Top Right Triangle Bottom Left Triangle Bottom Right Curved Tail Arrow via Ando Razafimandimby Trapezoid Parallelogram Star (6-points) Star (5-points) via Kit MacAllister Pentagon Hexagon Octagon Heart via Nicolas Gallagher Infinity via Nicolas Gallagher Diamond Square via Joseph Silber Diamond Shield via Joseph Silber Diamond Narrow via Joseph Silber Cut Diamond via Alexander Futekov Egg Pac-Man Talk Bubble TV Screen Lock
Alternative to CAPTCHA - Protect Web Forms from Spam with Javascript What’s the ideal check to protect your web forms from spambots? No one really likes having to copy squiggly letters from a CAPTCHA image, but is there a better alternative? The ideal check would be one that most people don’t ever notice, but which effectively keeps out all spambots. In this tutorial, I describe a technique that uses Javascript to recognise human activity based on screen events, which works very well for us. In a discussion on Scratch Forums on the merits of CAPTCHA, one of our members suggested a possible alternative that detected JavaScript events (mouse events, keystrokes) to show that it’s a human completing the form. I took on the challenge of creating a simple JS-based alternative to CAPTCHA, which I’ll explain below. High-level Requirements Am I Human? First of all, our form will need some way of sending the answer to “am I human” through to the back-end script. For this, I’ll just use a hidden field. Switch it For Humans Testing Results with Script Here’s what I do:
Beginning Game Development: Part VIII - DirectSound | Coding4Fun Articles Welcome to the eighth article on beginning game development. We have spent a lot of time working with the graphics capabilities of DirectX. We also covered how the DirectX API allows us to control input devices. Now we are going to look at another facet of DirectX, the ability to control sound devices. This capability is found in the DirectSound and AudioVideoPlayback namespaces. Sound in Games Sound creates an ambiance in a game that provides for a more immersive game experience. Sound effects also provide the same audible cues we expect in real life, such as the direction and speed of a person approaching us based on the volume, direction, and frequency of the footsteps. In BattleTank2005 I want to integrate sound in the following way. Secondly, I want to be able to play background music during game play and I want to control what music plays when in the game. DirectSound The DirectSound namespace only supports playing 2 channel waveform audio data at fixed sampling rates (PCM). Device
Gestures and Tools for Kinect - Eternal Coding You have certainly not missed (as a regular reader of this blog ) that the Kinect for Windows SDK is out! For now, however, no gestures recognition services are available. So throughout this paper we will create our own library that will automatically detect simple movements such as swipe but also movements more complex such as drawing a circle with your hand. The detection of such gestures enable Powerpoint control the Jedi way ! (similar to the Kinect Keyboard Simulator demo). If you are not familiar with the Kinect for Windows SDK, you should read a previous post that addressed the topic: There is an infinite number of solutions for detecting a gesture. Algorithmic search Template based search Note that these two techniques have many variants and refinements. You can find the code used in this article just here: GestureDetector class Skeleton stability
Blogs I was looking over the .net award nominees this week and stumbled across the flipboard.com website. I loved the scrolling navigation so much I just had to open up visual studio and try and recreate it myself. DemoView Demo The main thing flipboard do differently is to have the logo and logo background elements move at different animation speeds from each other and the main content. This effect is is similar to Parallex scrolling and gives the website more interest, depth and flair. I’ve documented the main steps to recreate my demo below: Step 1 First we need to make reference to the jQuery Library as we are going to use it alot. Step 2 Next we will want to add our HTML to the page this HTML will hold all of the layers and links that we will need to get the example running. The background triangle moves at a slightly different speed to the logo and so needs it’s own <div>. I have added the nav layer and placed 4 links into it so that the user can navigate between the different contentItems.
How to write a 32bit screen saver © 1997-1999 Lucian Wischik. This article describes the fundamental nuts and bolts of writing a saver. I have also written a second article with a more useful higher-level overview, and full source code for several example savers. Overview Screen savers start when the mouse and keyboard have been left idle for some time. They have five main purposes: To avoid phosphor burn caused by static images left on the screen. What a saver is A saver is a straightforward executable that has been renamed with the extension .scr, and which responds to particular command-line arguments in particular ways as detailed in the rest of this document. Version differences between '95, Plus! Windows NT does all saver password management itself, and closes savers automatically in response to keyboard or mouse events. Creating a saver This chapter describes the behaviour expected of a saver. How and when saver is executed The following list gives all the situations in which a saver will be launched. ConfigDialogProc
free tutorials Have you ever read through a chapter in one of those Learn Such and Such in 21 Seconds books and realized that somewhere along the way you had started daydreaming about how you would spend a trillion dollars if you were Bill Gates? Well, it happens to me all the time. Computer books are boring. In fact, most technical writing out there bites the big one and there's no sign that the situation is going to get any better in the near future. The really unfortunate thing about this predicament is that now, more than any other period in the history of computing, is when we really need good, clear writing out there. Whether the established priesthood of computer science likes it or not, the web has opened the flood gates and computer science is being secularized post haste. Well, the fact is that most people learning how to make a living on the web are not morons and if given the proper instructions can do just about everything they want to with their web sites, if not more.
CSS Inliner and Email Fixer - Mally The Free HTML Email Marketing Tool | Sign-up.to Emails can be read in thousands of combinations of operating systems, email clients and internet browsers. Creating an email which will display correctly across all these platforms requires a lot of resources, patience and testing. Mally will warn you of potential issues in your email campaign before it's too late. He utilises our expertise to analyse your email piece by piece until he is satisfied you have addressed these common issues. While he cannot guarantee your email will be perfect; by checking against the common problems encountered daily you will save yourself some costly and unnecessary mistakes. To use Mally, simply paste your HTML into the text area provided. When he analyses your email he won't overwrite or save your campaign in any way.
Top 10 Ways to be Screwed by "C" To get on this list, a bug has to be able to cause at least half a day of futile head scratching, and has to be aggravated by the poor design of the "C" language. In the interests of equal time, and to see how the world has progressed in the 20-odd years since "C" escaped from its spawning ground, see my Top 10 Ways to be Screwed by the Java programming language, and for more general ways to waste a lot of time due to bad software, try my Adventures in Hell page. A better language would allow fallible programmers to be more productive. Infallible programmers, of the type unix' and "C" designers anticipated, need read no further. In fairness, I have to admit that the writers of compilers have improved on the situation in recent years, by detecting and warning about potentially bad code in many cases. Non-terminated comment, "accidentally" terminated by some subsequent comment, with the code in between swallowed. a=b; /* this is a bug c=d; /* c=d will never happen */ Or consider this: or as
Download This download is ideal for situations where a custom build will not be required. This archive contains the full Dojo, Dijit, and DojoX projects, compressed and optimized for immediate deployment. All non-essential files have been removed from this distribution including tests and demonstrations. Dojo Base: dojo.js: compressed (41KB, gzipped) uncompressed (comments inline) A single-file download providing only the base Dojo APIs. A full, uncompressed source release of the Dojo Toolkit -- ideal for development.