[WIP] My first commercial 2D Game "Quest"

Dear Brothers and Sisters ,

Recently I am working on a 2D game called "Quest " using Unity 4.5.1 Free , still it is not ready . I have started with small steps , miles to go . Right now I am working on character animation and back ground designing . I am stuck on character Jump animation .

I will keep on posting my progress on this thread . I need your guidance as I am a beginner Game Programmer .

This is my first game … I am spending lots of time on it … yesterday night I just finished the jump animation … I am not an artist so it been very heard for me to make an character and put live on it … After a long night work I some how manage to complete the jump animation . I really don’t know how other will accept it … I am working on 30 days trial version of Fl software for creating an animation and character too .

Issue 1 # Need Help ! Is Solved Now (Thanks Nasso)

I have two camera one Main Camera and another one Player follow camera. Player follow camera is attached with player object .

Now when the player object is destroyed the player follow camera also getting destroyed And my main camera giving me the old view which is not in the current position where player got destroyed . How can i set the view to player destroyed position ? or is there other way to do that ?. What is the best practice i should follow ?

Issue #2 This Issue is Solved ( Thanks to MickM and Nasso)
Background Sound and player walk sound is overlapping each other … what is the best way I can place different sound altogether .

Currently I am working on Sound Integration with my Game (Done)

  1. Back Ground Sound
  2. Running Sound.
    3)Jump Sound.
  3. Coin Collect Sound
  4. Die Sound .

Progress Of my game .

Yesterday I am able to build few UI (Starting UI and Game Over UI ) and there interaction with user event . Feeling Confident :slight_smile:

I have made UI by my own :slight_smile:

Please Check End Level Screen . Let me know how it looks ?

I have started working on Unity UI .

I need your guidance and comment to keep up my game development.

Dada Ki khobar … ami bhi natun ekhane … stay in touch …

Please complete the profile information .

Why not use one camera and remove it from the player parent before destroying him.

Do something like

Camera.main.transform.parent = null;

to bring it back to the root of the hierarchy for example. Then call Destroy(player);

1 Like

Hi thanks for the reply … Let me try …

nasos_333 … Thanks buddy it works … But one problem … the camera is pointing to beginning stage … it is not pointing to where my player died … am I missing some thing .

Normally when removing the parent, the camera should keep its global properties, so as long as the camera looked at the hero, it should continue to do so. Check if there are any scripts attached to the camera that point the camera to a target.

If a “lookat” script pointed the camera to the hero position, maybe it has now lost the hero and thus point to 0,0,0 or something, as a default position.

Also make sure the camera is not re-parented somehwere else by another script.

ok … Buddy … Let me check

void Explode()
{

var cameraTransform = Camera.main.transform;
// make it a child of the current object
Transform trns = transform;
trns.position = new Vector3 (transform.position.x,3.314256f, -0.008056641f);
cameraTransform.parent = trns ;
// place it behind the current object
cameraTransform.localPosition = -Vector3.forward * 5;

Camera.main.transform.parent = null;
// make it point towards the object
cameraTransform.LookAt(trns);

//destroy our game object
Destroy(playerObject);

}

I did this . Now it is working fine for me . I have hard coded y, and Z because I don’t want to change this .

Thanks nasos_333 .

please find my code below … the problem is solved now … thanks …buddy

Great :), glad to be of help.

About the sound issue, i think you have to separate your background sound from the local sounds. What is the problem exactly, does one sound seem to stop or the other seems to overly override it ?

Where do you place your main music and where the hero steps ?

1 Like

Hi Nesso … actualy I have placed audio source with main camera … for background sound … and set loop and play on awake setting …

for my hero game object I have placed running sound attached with audio source . once I hit the runn button my runn sound should play one shot … and it is playing so …

what is the problem actually I feel … the sound itself …

my running sound length is big and loud … so evey update it is plying and multiple running sound is plying …

buddy please how should I place proper sound for background and also runn and jump … the runn sound clip should end when my runn animation stopped …

Thanks nesso …

What is your audio specific code?

1 Like

Hi MickM Please find my code below .

//------------------------------------Sound-------//
public AudioClip runnSoundClip ;
private AudioSource audioSource ;
void Awake()
{
audioSource = GetComponent ();

}

void FixedUpdate () {

foreach (Touch touches in Input.touches) {
if (moveUp.guiTexture.HitTest (touches.position) && touches.phase != TouchPhase.Ended)
{
anim.SetBool (“jump”, true);
jump = true;

}
if (moveLeft.guiTexture.HitTest (touches.position) && touches.phase != TouchPhase.Ended) {
if(audioSource.isPlaying){
audioSource.Stop();
}
audioSource.PlayOneShot (runnSoundClip,10.0f);

}
if (moveRight.guiTexture.HitTest (touches.position) && touches.phase != TouchPhase.Ended) {
if(audioSource.isPlaying){
audioSource.Stop();
}
audioSource.PlayOneShot (runnSoundClip,10.0f);

}
}
}

I am using Asset Store Foot Step Free Sound … As Sound Clip

The problem with sound is that we have no way to know what the result is or what you hear, so it is hard to debug.

How about trying to cut off the PlayOneShot when the sound is playing.

Like

if(audioSource.isPlaying){
**}**else{
audioSource.PlayOneShot (runnSoundClip,10.0f);
}

Hi Nasos ,

I found out the problem … yes you are right … I did it other away just now after so many R&D … main problem was with
audioSource.PlayOneShot (runnSoundClip,10.0f); function . The problem was it is playing every time on fixed update on pressing the forward button … so many sound instance is overriding each other and crating a outer world sound :slight_smile: .
So actuly what I did is from Audio source , I checked Loop and play on Awake both and also checked mute too …
… Now from my script I am just doing audioSource.mute = true or false .
Thanks Nasos …

np :), glad to be of help and that you solved the issue.

Sound is a bit hard to get right.

1 Like

Yaa ya … many more miles to go :slight_smile:

1 Like