Monday, March 24, 2014

Power-Ups Delayed, But Coming Very Soon

Working on the update became difficult to do while trying to work around real life. The power-ups are done, and we will be releasing some other content in this update. There will be accessories available to customize your bat, and the other bonus content to add that little bit of flair to the game.

I will also be waiting on testing before I release this update, but that should go well. If it doesn't there could be a few more days delay. Because there are some external things I'm waiting on, the goal is to get the update out by Friday, and so far it is looking good. After everything is working and the update is out on Google Play, I will be making a few small changes to release the update on Amazon (likely the next day I get a chance to work on it). I also plan on putting the game on iOS, since there are a lot of people that would love to play it on their iPhone. If I had to guess, I would say to expect it on iOS about a week after Friday.

Friday, March 7, 2014

Perfect Gravity Simulation Script

I took a break for a bit to just play around with something I had on my mind. I was wondering how I could do realistic body to body gravity simulation in unity, possibly for future use in a game mechanic. Unity's built in gravity must be set to 0, or it won't work correctly. I threw together a script based on Newton's law of universal gravitation, and came up with the following snippit.

 using UnityEngine;  
 using System.Collections;  
   
 public class GravityForAllObjects : MonoBehaviour  
 {  
   
   private float gravitationalForce;  
   private Rigidbody[] rbs;  
   
      void FixedUpdate ()  
   {  
     rbs = GameObject.FindObjectsOfType<Rigidbody>();  
     foreach (Rigidbody rb1 in rbs)  
     {  
       foreach (Rigidbody rb2 in rbs)  
       {  
         if (rb1 != rb2)  
           ApplyGravity(rb1, rb2);  
       }  
     }  
      }  
   void ApplyGravity(Rigidbody object1, Rigidbody object2)  
   {  
     // Real value for G is 0.0000000000667384 -- using larger value in order to use smaller masses i.e. true mass divided by 1,000,000,000 kg  
     // mass in killograms, distance in meters, yields force in newtons.  
     gravitationalForce = 0.0667384f * ((object1.mass * object2.mass) / (object2.transform.position - object1.transform.position).sqrMagnitude);  
     object1.AddForce((object2.transform.position - object1.transform.position) * gravitationalForce, ForceMode.Force);  
   }  
 }  

I'm not sure how useful this code can be, but I decided to share it anyway. Unlike other gravity scripts I've seen, this one actually takes the mass of both rigidbodies into account, and adds force to both. If you set up a few objects in the editor with a simple script to set an initial velocity perpendicular to the line between the object and a single more massive object, you can easily achieve orbit-like patterns. I'm not sure how well this can scale up/down.

Monday, March 3, 2014

Power-Ups! Go Batty Update Coming Soon

As I mentioned in my previous post, another update will be coming to Go Batty. You will be able to earn coins from game play that you can use to purchase power-ups from the brand new "Batty Shack" for big scores.

One of the power-ups will include reducing your speed, which will make longer runs possible. There will be several more I do not wish to describe yet to keep them a surprise. The power-up framework will allow the addition of more power-ups pretty easily with future updates.

Also in the update, there will be background visuals, making the game look more awesome. There will be some minor tweaks in difficulty, and the score screen at the end of the game is getting a new and improved design.

The Batty Shack will also include other new awesome features. So stay tuned for more update information as it nears completion. Have fun playing, and don't forget to click share below!