Current Project

My current Unity project is a space exploration/base building game. Kind of  Rimworld meets Starflight. Still in the very early stages (as most of my projects tend to be) and full of programmer art, but I’m happy with the results so far.

Just finished a first pass at optimizing the lighting system which does the whole “light spills around corners” thing in real time. It’s kind of cool to see light smoothly expand out into a hallway as a door opens.

I hope to blog about the game’s development progress and probably some technical things about things I’m doing with Unity. But for now, pictures…

Lighting:

Random planet generator experiments:

Power grid testing:

2 thoughts on “Current Project”

  1. I would be interested in creating art for your game. If you would like to email me we can talk about your project some more.

    1. using UnityEngine;
      using System.Collections;
      using System;
      using UnityEngine.UI;
      public class FlashCard : MonoBehaviour
      {
      public GameObject animationFontObject, animationLeftObject,animationRightObject;
      public Text questionText;
      public Text[] optionsText;
      public Text answerText;
      public Text swipeInstructionText;
      public ToggleGroup toggleGroup;
      public RawImage frontSide, backSide;

      private float animationTime = 0.5f;
      private bool isZoomIn = false;
      private bool isAnimationPlaying = false;
      private bool isNextCardAnimationPlaying = false;

      private static FlashCard _instance;
      public static FlashCard instance
      {
      get
      {
      if(_instance == null)
      {
      _instance = GameObject.FindObjectOfType();

      }

      return _instance;
      }
      }

      private void Start()
      {
      this.SetCardImages();
      }

      public void Animation(bool zoomIn =true)
      {

      this.isZoomIn = zoomIn;
      if(this.isZoomIn)
      {
      this.transform.localPosition = this.animationLeftObject.transform.position;
      this.transform.localEulerAngles = this.animationLeftObject.transform.eulerAngles;
      this.SetQuestion(GameController.instance.CurrentQuestion());
      }
      this.isAnimationPlaying = true;

      iTween.ValueTo(this.gameObject, iTween.Hash(“from”, this.isZoomIn ? this.animationLeftObject.transform.localPosition : this.animationFontObject.transform.localPosition, “to”, this.isZoomIn ? this.animationFontObject.transform.localPosition : this.animationRightObject.transform.localPosition, “time”, animationTime, “oncomplete”, “CompleteAnimation”, “onupdate”, (Action)(val =>
      {
      this.transform.localPosition = (Vector3)val;
      }
      )));

      iTween.ValueTo(this.gameObject, iTween.Hash(“from”, this.isZoomIn ? this.animationLeftObject.transform.localEulerAngles : animationFontObject.transform.localEulerAngles, “to”, this.isZoomIn ? animationFontObject.transform.localEulerAngles : this.animationRightObject.transform.localEulerAngles, “time”, animationTime, “onupdate”, (Action)(val =>
      {
      this.transform.localEulerAngles = (Vector3)val;
      }
      )));

      iTween.ValueTo(this.gameObject, iTween.Hash(“from”, this.isZoomIn ? this.animationLeftObject.transform.localScale : animationFontObject.transform.localScale, “to”, this.isZoomIn ? animationFontObject.transform.localScale : this.animationRightObject.transform.localScale, “time”, animationTime, “onupdate”, (Action)(val =>
      {
      this.transform.localScale = (Vector3)val;

      }
      )));
      }

      private void CompleteFlipAnimation()
      {
      this.isAnimationPlaying = false;

      }

      private void CompleteAnimation()
      {
      this.isAnimationPlaying = false;

      if (!this.isZoomIn)
      {

      this.EmptyCard();
      }

      }

      private void OnMouseDown()
      {
      if (!this.isAnimationPlaying && !isZoomIn)
      {
      this.Animation(true);
      GameScene.instance.DisableLabel();
      }
      }

      public void DetectSwipe(SwipeDirection swipeDirection)
      {
      if(this.isAnimationPlaying || !this.isZoomIn)
      return;

      if (!isAnyAnswerSelected ())
      return;

      if (swipeDirection == SwipeDirection.Left || swipeDirection== SwipeDirection.Right)
      {
      backSide.raycastTarget = true;
      this.FlipCard(swipeDirection == SwipeDirection.Left ? 1 : -1);
      }
      else if (swipeDirection == SwipeDirection.Up && GameController.instance.CurrentGameMode() == GameMode.Memory )
      {
      GameController.instance.SetPreviousQuestionNumber();
      this.GoToNextQuestion();
      }
      else if(swipeDirection == SwipeDirection.Down)
      {
      CheckAnswerAndUpdateScore ();
      GameController.instance.SetNextQuestionNumber();
      this.GoToNextQuestion();
      }
      }

      private void FlipCard(int direction)
      {

      this.isAnimationPlaying = true;
      iTween.ValueTo(this.gameObject, iTween.Hash(“from”, this.transform.localEulerAngles, “to”, this.transform.localEulerAngles + new Vector3(0, 180f * direction, 0f), “oncomplete”, “CompleteFlipAnimation”, “time”, animationTime, “onupdate”, (Action)(val =>
      {
      this.transform.localEulerAngles = (Vector3)val;
      }
      )));
      }

      public void EmptyCard()
      {
      this.questionText.text = “”;

      string answerText = “”;
      string optionText = “”;
      for (int i = 0; i < optionsText.Length; i++)
      {
      this.optionsText[i].text = "";

      }
      this.answerText.text = "";

      this.swipeInstructionText.text = "";

      }

      public void SetQuestion(Question question)
      {
      backSide.raycastTarget = false;

      this.ResetAllOptions ();
      this.questionText.text = question.question;

      if (question.questionType == "text" ) {
      Debug.LogWarning ( "text : " + question.answerType);
      }
      else if (question.questionType == "image") {
      Debug.LogWarning ( "image : " + question.answerType );
      }
      else if (question.questionType == "audio") {
      Debug.LogWarning ( "audio : " + question.answerType );
      }

      string answerText ="";
      string optionText = "";

      for (int i = 0; i < optionsText.Length; i++)
      {

      if (question.options.Count <= i)
      break;

      optionText = question.options[i].title;

      if (answerText == "" && question.options[i].correct)
      {
      answerText = optionText;
      }
      if (GameController.instance.CurrentGameMode() == GameMode.Standard)
      {
      this.optionsText[i].text = optionText;
      }
      }

      this.answerText.text = answerText;

      this.swipeInstructionText.text = "Swipe to flip the card";
      }

      public void CheckAnswerAndUpdateScore()
      {
      if (GameController.instance.CurrentGameMode () == GameMode.Memory)
      return;

      string selectedAnswerText = "";
      string selectedOption = "";
      foreach (Toggle t in toggleGroup.ActiveToggles())
      {
      if ( t.isOn )
      {
      selectedAnswerText = t.transform.GetComponentInChildren().text;
      break;
      }
      }

      for (int i = 0; i < GameController.instance.CurrentQuestion ().options.Count; i++)
      {
      if ( GameController.instance.CurrentQuestion ().options[i].title == selectedAnswerText)
      {
      switch (i)
      {
      case 0:
      selectedOption = "a";
      break;

      case 1:
      selectedOption = "b";
      break;

      case 2:
      selectedOption = "c";
      break;

      case 3:
      selectedOption = "d";
      break;

      }
      Debug.Log ( "selectedOption : " + selectedOption );
      break;
      }
      }

      GameController.instance.AddAnswerToJson (GameController.instance.CurrentQuestion().id, selectedOption);

      if (this.answerText.text.Equals (selectedAnswerText))
      {
      Debug.LogWarning ("selectedAnswerText : " + selectedAnswerText);
      GameController.instance.AddScore ();
      }
      else
      {
      Debug.LogWarning ( "Incorrect Answer : " + selectedAnswerText );
      }
      }

      public void ActiveCard()
      {
      this.GetComponent().enabled = true;
      }

      public void DeActiveCard()
      {
      this.GetComponent().enabled = false;
      }

      public void GoToNextQuestion()
      {
      if (this.isNextCardAnimationPlaying)
      return;

      StopCoroutine(“NextCard”);
      StartCoroutine(“NextCard”);
      }

      public IEnumerator NextCard()
      {
      this.isNextCardAnimationPlaying = true;
      this.Animation(false);
      yield return new WaitForSeconds(this.animationTime + 0.3f);

      if (GameController.instance.isGameOver)
      {
      yield return new WaitForSeconds(0.5f);
      GameController.instance.GameOver();
      this.isNextCardAnimationPlaying = false;
      yield break;
      }
      this.Animation(true);

      yield return new WaitForSeconds(this.animationTime);
      this.isNextCardAnimationPlaying = false;
      }

      public bool IsNextCardAnimationPlaying()
      {
      return this.isNextCardAnimationPlaying;
      }

      public void SetCardImages()
      {
      this.frontSide.texture = GameController.instance.frontCard;
      this.backSide.texture = GameController.instance.backCard;
      }

      public void ResetAllOptions()
      {
      if (GameController.instance.CurrentGameMode() == GameMode.Memory)
      return;
      toggleGroup.allowSwitchOff = true;
      foreach (Toggle t in toggleGroup.ActiveToggles())
      {
      t.isOn =false;
      }
      toggleGroup.allowSwitchOff = false;
      }

      private bool isAnyAnswerSelected ()
      {
      if (GameController.instance.CurrentGameMode() == GameMode.Memory)
      return true;
      bool isAnswerSelected = false;
      foreach (Toggle t in toggleGroup.ActiveToggles())
      {
      if ( t.isOn )
      {
      isAnswerSelected= true;
      break;
      }
      }
      return isAnswerSelected;
      }

      }

      this is my code here i wrote code for text but i want to write code for the image how to render the image as options please help me

Leave a Reply

Your email address will not be published. Required fields are marked *