annawenger / HungryPenguin

0 stars 3 forks source link

Fish spawning #2

Open annawenger opened 5 years ago

annawenger commented 5 years ago

@smeerws The fishes are spawning, but just as long as the first fish isn't collected. And all cloned Fish-Objects don't become counted when they are collected.

smeerws commented 5 years ago

I would realize the fish on/with the platform as part of the icesheet script.

public void InstantiateFischOnSheet(Vector2 icesheetPos)
{
    GameObject go = Instantiate(fish, new Vector3(0.0f,0.0f,0.0f), Quaternion.identity,this.transform);
    go.gameObject.transform.localPosition = GetFishPosition();
}

In another function e.g. private void RandomInstantiateFishOnSheet(), it would be possible to randomly assign the fish to the platform -- random + call InstantiateFischOnSheet(Vector2 icesheetPos) -- and afterwards call the RandomInstantiateFishOnSheet() in the start method of the icesheet script.

smeerws commented 5 years ago
private Vector2 GetFishPosition ()
{
    return new Vector2 (fishPosX, fishPosY);
}

shift fish away from 0.0 of icesheet

A scriptable object would be helpful to hold data like time and score points. For collecting the fish be sure that all objects (player, fish) have a collider.