Frog The Door Games


  • Home
  • Vintage Hero
  • Alawishus Pixel
  • Space Racer
  • Cryptogram
  • Other Stuff
  • Contact

Adding a Rumble Component to Your Game

5/11/2011

4 Comments

 
Let's face it. Rumble and XNA haven't had the best history. I still hear people refer to "massage games" and such when people talk about Xbox Live Indies, but there are many out there who can now look past the sea of undesirables and see the potential and successful. It's come a long way since it's innocent beginnings. Yet many developers still shy away from utilizing force feedback and some that do, use it in a brute force kind of way that can annoy the player. Even some AAA titles seem to just set the motors at full blast for three seconds when you crash off the road. Ugh. When it comes to rumble, subtle is the way to go.

Before I go on, I'd like to say that the following code is free to use in your game and is licensed under the Microsoft Permissive License with one caveat. You can not use this component in a game where the sole purpose is to vibrate the controller. You cannot use this for a "massage game" or any other where the purpose of the application is rumble based. You can only use it to enhance existing gameplay where otherwise, not having rumble will not change the objective of the game. Hate that I have to say it, but it needs to be said.

Here I've implemented a time dependent, dynamic based rumble component. I've played many indie games that accidentally leave the motors running until I quit to the dashboard. You can get around this by using time based triggers. When an event happens that requires force feedback (say a collision) just add a new rumble for a set amount of time and when the times up, the rumble stops.

To make things subtle I use the idea of dynamics. Since sound is a vibration, we can use it as an example in which to compare. In music, dynamics are control over the volume of the sound, or intensity of the vibration. By varying the dynamics over time, I could apply a "shape" to the controller's rumble. I've added the ability to change to different rumble shapes by calling them by name, such as binary (on/off), linear (start at minimum and increase to maximum over time) or parabolic (fade in to maximum by time/2 and fade out to minimum by time).


Read More
4 Comments

Pseudo 3-D effects with SpriteBatch

3/9/2011

0 Comments

 
To make the pseudo 3-D effect of the trophy and ship spinning around each other on the final screen of Space Racer I just used a simple scaling trick. By gradually changing the scale in SpriteBatch it appears as if the sprites are zooming in and out along the Z-axis.

To do this, let's first make a new Windows Game project in C#. Call it SpinningSprites. Click OK, build and run the empty game to be presented with the familiar cornflower blue screen.

Now that we know everything was created as planned we need to add content to our project.
Go ahead and copy these images to your hard drive by right clicking and saving. Or if you'd like, you can use your own images. Add them to the game by dragging the images to the SpinningSpritesContent project in Visual Studio or right click on the SpinningSpritesContent project and choose Add->Existing Item. Find and select the images and click Add.

Now that we've added the content it's time to add some code. Towards the top of the class, add two Texture2D variables just after the GraphicsDeviceManager and SpriteBatch declarations.

    Texture2D imageOne;
    Texture2D imageTwo;


Read More
0 Comments

Fixed Position Virtual Thumbsticks

8/3/2010

1 Comment

 
Looking at the new samples on the creators.xna.com I see they have an example for using virtual thumb sticks in a Windows Phone 7 game. I like it, but I decided I wanted a version with the thumbs sticks fixed in place, much like you'd see in an iPhone shooter like Call of Duty: World at War: Zombies. Here's a screen of the result.
Picture

The first thing I decided was to not make the Virtual Thumbstick class static, but instead a DrawableGameComponet. While not consistent with other XNA input implementations, it allows you to add one or more thumbsticks to the list of components and let them load, draw and update without calling any methods. You can simply look at the thumbstick position, see if it's greater than zero, and determine what to do with it when it is.

Read More
1 Comment
    RSS Youtube Twitter Facebook

    Games

    Vintage Hero
    Alawishus Pixel
    Space Racer
    Crytpogram


    Tweets by @frogthedoor



    Archive

    August 2017
    July 2017
    February 2017
    October 2014
    September 2014
    July 2013
    June 2012
    May 2012
    March 2012
    January 2012
    December 2011
    October 2011
    September 2011
    August 2011
    July 2011
    May 2011
    March 2011
    February 2011
    January 2011
    November 2010
    September 2010
    August 2010
    July 2010
    June 2010
    May 2010
    April 2010


    Categories

    All
    Alawishus Pixel
    Cryptogram
    Development
    Press
    Programming
    Screen Shots
    Setlist
    Space Racer
    Tutorial
    Video
    Vintage Hero
    Windows Phone
    Windows Phone 7
    Xna

    RSS Feed



Powered by Create your own unique website with customizable templates.