[PROTOTYPE] Frizbee Pong

edited in Projects
This is a little prototype that I was working on over the weekend.

image

Player One:
WASD to move
Space to Serve

Player Two:
Arrow keys to move
Enter to Serve

first player to 3 wins.

Windows web build:
https://dl.dropboxusercontent.com/u/187819585/FrizbeePong ver 0.1/FrizbeePong ver 0.1.html

Any crit is welcome.

Comments

  • Nice one - I like this idea :)

    Since it's frizbee; how about making them catch the frizbee first and then release in a chosen direction instead of just bouncing? Another suggestion that I think could be cool - things that could be hit for points, like frizbee golf, and if you miss the opponent gets a chance to play - or some kind of mechanic like that..
  • @farsicon yeah the catching idea was something I wanted. Got a empty object attached to the player rotating, but couldnt get the frizbee instantiated at its rotation. Think it was because of the behaviour I gave to the frizbee. Will need to relook.
  • It's working pretty well, but I think you should also clamp each player to their half of the field. Launching frisbees directly into the enemy goals isn't super funtimes for the other player. :P
  • edited
    Okay so I have implemented the ideas suggested by farsicon above. Each player now catches the frizbee and then serves it. Each player has an arrow to show the serve direction. The longer you hold the serve button the harder/faster your player will serve. The aiming was made possible by the very cool guys from GameLogic. Thanks for the extensions they are awesome. Here is the latest build:

    https://dl.dropboxusercontent.com/u/187819585/Frizbee Pong Ver 0.2/Frizbee Pong Ver 0.2.html

    However, I tried to modify the rotating code a bit, so that the arrow only rotates in one direction for a while and then starts moving in the opposite direction again. Here is the code i am using:

    using UnityEngine;
    using System.Collections;
    
    public class RotatingMuzzleExample : MonoBehaviour {
    
    	public float rotatingValue = 4.0f;
    	public Transform muzzle;
    	private bool reverse = false;
    	private bool moveEnabled = false;
    	public float movementTime = 1.0f;
    
    	// Use this for initialization
    	void Start () 
    	{
    		moveEnabled = true;
    		StartCoroutine(MoveOverTime());
    	}
    
    
    	IEnumerator MoveOverTime()
    	{
    		float timer = 0;
    		while(true)
    		{
    			if(moveEnabled)
    			{
    				if(!reverse)
    				{
    					timer += Time.deltaTime;
    					rotatingValue = 4.0f;
    				}
    				else
    				{
    					timer -= Time.deltaTime;
    					rotatingValue = -4.0f;
    				}
    				if(timer > movementTime)
    				{
    					reverse = true;
    				}
    				else if(timer < 0)
    				{
    					reverse = false;
    				}
    				Gamelogic.TransformExtensions.RotateAroundZ(muzzle,rotatingValue);
    			}
    			yield return null;
    		}
    
    	}
    
    }


    This works great...when the game starts. However as soon as I press "R" to restart, or when you press "Enter" after a match to restart, my code bugs out. When the game starts the aiming arrows rotate from the middle up 90 degrees and then down 180 degress (top to bottom and then back again - which is exactly what i want). However as soon as I

    Application.LoadLevel(Application.loadedLevel);


    They move from left to right and back. Any idea what I am doing wrong. I am guessing that I need to add something to a Start() somewhere to stop this from happening, but can't figure out what. Any help would be greatly appreciated.

    [EDIT] - well this is f@$5^& great - now they are moving left to right instead of up and down right from the start (if I open my web player above). In my Unity Editor they were moving up and down when I pressed play and only started going left to right when I loadlevel?????
Sign In or Register to comment.