Code Monkey home page Code Monkey logo

unityplayground's Introduction

Unity Playground

playground.png

This project can be found and downloaded on the Asset Store

Description

A collection of simple scripts to create 2D physics games, intended for giving workshops to an audience of beginner game developers to quickly enable them to make games in Unity.

Documentation

Objective

This project is intended to be as flexible as possible, not enforcing a specific game genre apart from the obvious constraints of being 2D and physics-powered. It contains a lot of scripts that perform atomic tasks, that is they do mostly only one thing, so you can combine them to create any kind of gameplay.

That said, the audience should already have an idea of how Unity works, the Editor interface, the concept of GameObjects, Components, the Scene View, Play Mode, and so forth. It might be useful to guide them through these concepts before letting them play with this project.

Usage instructions

Documentation can be found in pdf form under Assets/Documentation

Software Requirements

Required: Any Unity 2017.4 or later version

Hardware Requirements

Required: Laptop

Change Log

  • 1.0 (2018/12/12) - initial release on the Asset Store.

unityplayground's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

unityplayground's Issues

Code is missing a license

Thanks so much for publishing the code for this! Can you please add a license to the repo? Without one, the ability of others to use this code is limited.

Editable Documentation

Is it possible to change the documentation on the repository to an editable format instead of PDFs? That way it would be easier to contribute to it and even work in translations for it.

I'm from a non-english speaking country and would be great to be able to point people I'm teaching to this repository and that they are able to find documentation in their own language.

Error Picking Coin on RogueLike

Hi,

I've found an error when trying the roguelike scene, when the player tries to pick up the coin, it gaves this error:

MissingReferenceException: The variable resourceItemPrefab of UIScript doesn't exist anymore.
You probably need to reassign the resourceItemPrefab variable of the 'UIScript' script in the inspector.
UnityEngine.Object.Instantiate[GameObject] (UnityEngine.GameObject original) (at C:/buildslave/unity/build/Runtime/Export/UnityEngineObject.cs:201)
UIScript.AddResource (System.String resourceType, Int32 pickedUpAmount, UnityEngine.Sprite graphics) (at Assets/Scripts/DONT_USE/User Interface/UIScript.cs:135)
ResourceAttribute.OnTriggerEnter2D (UnityEngine.Collider2D otherCollider) (at Assets/Scripts/Attributes/ResourceAttribute.cs:33)

and under the UIScript, we can't assign the resourceItemPrefabs, since its hidden by the editor script, how do we fix this?

Thanks

Wander Behaviour

This script will make an object wander around.

using UnityEngine;
using System.Collections;

[RequireComponent(typeof(Rigidbody2D))]
public class Wander : Physics2DObject
{
	// These are the forces that will push the object every frame
	// don't forget they can be negative too!
	Vector2 directionAndStrength = new Vector2(1f, 0f);

    public float speed = 2f;

	//is the push relative or absolute to the world?
	public bool relative = true;

    public float DirectionChangeInterval = 2f;

    void Start()
    {
        InvokeRepeating("ChangeDirection", 0, DirectionChangeInterval);
    }

    void ChangeDirection()
    {
        directionAndStrength = Random.insideUnitCircle;
    }
	
	// FixedUpdate is called once per frame
	void FixedUpdate ()
	{
		if(relative)
		{
			rigidbody2D.AddRelativeForce(new Vector2(directionAndStrength.x, directionAndStrength.y) * speed);
		}
		else
		{
			rigidbody2D.AddForce(new Vector2(directionAndStrength.x, directionAndStrength.y) * speed);
		}
	}
}

TakeBall Action

My kids tried to make a quiddich game. Here's a quick action that I coded up for it.

using UnityEngine;
using System.Collections;

public class TakeBall : Action {

    public override bool ExecuteAction(GameObject other)
    {
        other.transform.SetParent(transform);
        other.GetComponent<Rigidbody2D>().isKinematic = true;

        return base.ExecuteAction(other);
    }
}

Importing PP as a Project doesn't provide menu options to turn on/off Playground

When importing the current build of the project from GutHub, the only option available under 'Playground' in file menu is 'Export Unity Package' - options to turn on/off Playground Project are not available (although these are demonstrated when the current Global Game Jam Installer Package is used). (Using Unity 2017.3.f1 Personal edn)

Toggling between Playground On/Off

Hi Ciro :)
Using Unity v2018.3.6f1 and the current Unity Asset Store build of the Unity Playground, I find that some console errors are thrown after toggling between Playground On/Off a couple of times (first time is fine). As a consequence, the user is no longer able to toggle between these modes. The Console Log seems to indicate that the issue relates from syntax changes:

Assets/INTERNAL/Scripts/Editor/DefaultComponents/GameObjectInspector.cs(101,49): warning CS0618: UnityEditor.PrefabUtility.GetPrefabParent(UnityEngine.Object)' is obsolete: Use GetCorrespondingObjectFromSource.'

Assets/INTERNAL/Scripts/Editor/DefaultComponents/GameObjectInspector.cs(112,35): warning CS0618: UnityEditor.PrefabUtility.RevertPrefabInstance(UnityEngine.GameObject)' is obsolete: Use the overload that takes an InteractionMode parameter.'

Assets/INTERNAL/Scripts/Editor/DefaultComponents/GameObjectInspector.cs(115,91): warning CS0618: UnityEditor.PrefabUtility.GetPrefabParent(UnityEngine.Object)' is obsolete: Use GetCorrespondingObjectFromSource.'

Assets/INTERNAL/Scripts/Editor/DefaultComponents/GameObjectInspector.cs(115,157): warning CS0618: UnityEditor.ReplacePrefabOptions' is obsolete: This has turned into the more explicit APIs, SavePrefabAsset, SaveAsPrefabAsset, SaveAsPrefabAssetAndConnect'

Assets/INTERNAL/Scripts/Editor/DefaultComponents/GameObjectInspector.cs(115,35): warning CS0618: UnityEditor.PrefabUtility.ReplacePrefab(UnityEngine.GameObject, UnityEngine.Object, UnityEditor.ReplacePrefabOptions)' is obsolete: Use SaveAsPrefabAsset or SaveAsPrefabAssetAndConnect with a path instead.'

Cheers,
Jim

ObjectShooter only shoots things on the up Y axis

ObjectShooter only shoots things on the up Y axis, requiring a bit of hierarchy work (parent a sub-object, rotate it) to have something shoot in another direction.

Suggestion: it would be better if the user could decide the axis to shoot from directly in the component.

Possible issue with Jump.cs

From Art of Jimbo on Twitter

the jump scrip, even with a 'ground' tag still seems to let player jump a little higher than they should. I thought the 'ground' tag would allow player to jump once and then drop back down (depending on gravity, drag etc) but it seems even with platform elements tagged with 'ground' you can still make player jump more than they should

Auto Rotate script always starts rotation from 0

Auto Rotate script always starts Z rotation from 0, so if an object is rotated somehow differently it will restart from 0 when the game is launched.

Needs to be starting from the current rotation.

Defender Score

The score on the Defender game does not update when you hit a meteor. Would it be possible to implement or suggest a fix for this?
Roger

Prefab follow target

Follow Target stops working when object becomes a prefab. Player cannot be set as a target for prefab.

usability and features

after one day workshop with kids (10/12y) these are my main requests to allow them do next GGJ (maybe i'll submit some PR if you agree):

  1. move the Playground components scripts in a custom menu
  2. improve the wander script with container area (or radius)
  3. create a generic bullet that decreases 1 health live to the enemy, destroying it at 0 lives. this allows bosses and different enemies
  4. set Gravity to 0 as default always
  5. check integration with Fungus framework ( https://github.com/snozbot/fungus/ ) to not reinvent the wheel for so many features like dialogs and animations)

Unity Crash

Each time I try to open a Scene Unity crashed I am using unity 5.3.5

Asset-Store Fork: Follow Target (script) - lag introduced when 'Look at Target' selector enabled

When using the 'Asset-Store' fork (as advised by Ciro) a bug is encountered in the 'Follow Target' (movement) script, if the 'Look at Target' selector is ticked.

The bug manifests itself as a lagging response as the game object with the 'Look at Target' script applied continually readjusts its orientation to match the target (using the orientation specified), but will not commence the pursuit until the target game object stops moving. This glitch manifests regardless of the chose orientation from the drop-down menu.

If the 'Look at Target' selector is left unticked the 'Follow Target' behaviour performs as expected and constantly pursues the target game object.

Auto Object Spawner script

i am trying to teach my son how to make his first code by following this tutorial (https://unity3d.com/learn/tutorials/topics/2d-game-creation/2d-games-non-programmers?playlist=17093) but seems like update version is missing "Auto Object Spawner" script or either replaced with something else that i can't find in the update version. we are so close to complete the tutorial and don't want to put him down with all the work we have done so far. it will be kind if anyone can help to guide which script is replaced or where i can find it.

thank you for your help in advance.

Ability to add localization

Hi, I want to use this project to help people in my town to learn video game development but the language is a big barrier. Is it possible to build some foundation for it to support translation? I want to translate all the components and their variables/options to turkish and teach the kids that way.

Thanks

TransformInspector breaks changing field values by mouse-drag.

When teaching I've always emphasised certains aspects of the UI that are consistent and can be relied on. Good UIs generally are also very consistent.

UnityPlayground makes the Unity UI objectively worse in one respect by changing the usual behaviour of numeric fields in the Inspector.

"Hey everyone - notice how you can change values in any number field by dragging with the left mouse button over the label? That's often a really good way to change values and see the results immediately"

"Please sir, why doesn't it work in for Transforms?"

"Erm. It will do on normal Unity projects but for reasons I don't want to go into right now, it doesn't work if we're using UnityPlayground"

I know it's a small thing but it's the kind of thing that chips away at students ability to form a nice mental model of how the software works.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.