Be the first to post for 'Make Game Moments'!

If you’re reading this, there probably aren’t very many posts yet. But don’t worry, you can be the first! Either create a new post or just reply to this one to say ‘hi’.

1 Like

My quick game moment :slight_smile:

8 Likes

Here’s the 15s game moment for Levitaste -

‘Avoid sharp knives, bouncing onions and getting sucked into the extractor fan as you guide your carrot to the chopping board!’

Let me know what you think :slight_smile:

20 Likes

My gamemoment :

11 Likes

My game moment, added Rigidbody to some blocks and balls. Sorry its 44 seconds long :frowning:

19 Likes

Nice work @Toe71. I like the physics-base puzzle aspect a lot. It’s not just about your flying dexterity but also makes you think. :slight_smile:

If you want the objects to move a bit faster try adding a new “Physic Material” (yes Unity spelt physics wrong) with lower friction to your objects. Adding more mass to the objects should also make them fall faster.

2 Likes

Here is my current game moment, which is actually still sits within my original sandbox level.
I’ll build a proper level soon but the sandbox currently has everything I need for prototyping and working on the general vibe of the game. :slight_smile:

So the essential experience I’m working towards is one of mystery and exploration, searching for items to help repair your ship.

Next up will be adding enemies/obstacles to the sandbox and then I get to make my first actual level!

15 Likes

Cheers Gary, that will be very useful as i have a few other niggles that dont feel quite right so will play with the physics and adding new physic material this weekend :+1:

Excellent now that is more like the thrust game i knew as a kid and what i was hoping we were going to make in this course :+1:

How did you get the ship to be able to pick up the objects ? And do they affect the physics of the ship like in thrust?

I look forward to seeing the revisions @Toe71. Let me know when you have the demo ready.

I’m using a lot of stuff that hasn’t been covered at this point in the course.
I’m using spring joints on the pickups and a fixed joint on the rocket (which seems to be causing some really weird movement bugs). It’s probably not the best way of doing it but it does the job for the prototype.

Unlike Thrust, my game does have drag, so the physics feels different. The pickups do have mass, so you will fly slower when carrying objects and they can pull you about if you’re not careful.

I’ll try and get a demo link up in the next few days for playtesting, before I go and start creating proper assets.

I also went with a challenging, physics-based game in which all pink surfaces kill you, and you must collect yellow cubes to progress, as opposed to reaching a landing pad.

This is a nasty moment that forces the player to balance and use a block as “cover”

16 Likes

That’s awesome. Looks hard but I like it!

My simple game moment

9 Likes

nice , can u plzz tell me how you are moving the camera with the rocket bro???

@naman_rana a simple follow player script is like this:


 public GameObject player;       //Public variable to store a reference to the player game object


    private Vector3 offset;         //Private variable to store the offset distance between the player and camera

    // Use this for initialization
    void Start () 
    {
        //Calculate and store the offset value by getting the distance between the player's position and camera's position.
        offset = transform.position - player.transform.position;
    }
    
    // LateUpdate is called after Update each frame
    void LateUpdate () 
    {
        // Set the position of the camera's transform to be the same as the player's, but offset by the calculated offset distance.
        transform.position = player.transform.position + offset;
    } 

source: https://unity3d.com/learn/tutorials/projects/2d-ufo-tutorial/following-player-camera

2 Likes

I made somewhat like the above script but I didn’t expose the player publicly. Using [SerializeField] and putting it as private variable is more convenient. You can do it without serializing it in Unity’s Inspector by finding the Rocket.cs script through code like this: (I also declared Vector3 variable called offset to fine tune the camera’s x, y and z position to my liking)

public class MainCamera : MonoBehaviour
{
    [SerializeField] private Vector3 offset = new Vector3(0f, 0f, -10f);
    private Rocket rocket;

    // Use this for initialization
    void Start()
    {
        rocket = FindObjectOfType<Rocket>();
    }

    // LateUpdate is called once per frame after every Update
    void LateUpdate()
    {
        transform.position = rocket.transform.position + offset;
    }
}
2 Likes

Here’s my simple game moment:

The main issue I want to fix with what I’ve got so far is how those spotlights look on the obstacles. In particular, there’s some weird flicker when the obstacles on the right move under the spotlight. Still need to play more with lighting to see how to make that look more natural.

4 Likes

Hey garypetie!

Your gameplay video look awesome! Very cool. Can you give some hints (or a nice succinct explanation) about creating the fuel mechanic? Is that one of the features you mentioned is outside the course content? I got my pickup items working and next I would like to figure out how to make those pickups add fuel to my rocket.

1 Like

It’s actually pretty simple @Crede.Pendrel.

Here’s the method I wrote. You can obviously make it more complicated but mine just burns a constant amount of fuel whilst the ship is thrusting.

public void BurnFuel () {
	fuelComsumption = fuelBurnMultiplier * Time.deltaTime;
	currentFuel = Mathf.Clamp(currentFuel - fuelComsumption, 0, maxFuel);
}  

So, fuelConsumption is the actual rate at which the fuel is being burnt. You can make the formula as simple or complex as you like.
currentFuel should hopefully be self explanatory. It’s also the number you show on the UI in whatever form you like.

This method is called inside the RespondToThrust method (or whatever you called yours).

Here’s mine for reference:

void RespondToThrust () {
    vertical = CrossPlatformInputManager.GetAxis("Vertical");
    if (vertical > 0f && rocket.GetCurrentFuel() > 0) {
    	rocket.ApplyThrust();
    	rocket.BurnFuel();
    	rocket.PlayEngineEffects();
    }
    else {
    	rocket.StopEngineEffects();
   	}
}

Notice that before I apply any thrust, I’m check that there is actually fuel in the tank. This code might look strange because I’m using a getter and calling it from another script. However, you could just cram it all into one script and/or reference the variable directly if that’s how you’ve set things up.

PM me if you’d like a more detailed explanation of how I implemented things and I’d be happy to help you adapt it for your own game.

3 Likes

Great thank you! I am going to progress thru a few more lectures before implementing this. I looked ahead on the github and saw some work to be done before inserting this code. I’ll let you know how it goes!

1 Like

Privacy & Terms