Awakened Team

Click on the name to see what he/she's working on. (WIP blog)

Founders: 3D modelers:
Writers: Programmers:
  • Coen46 (No Link)
  • Mutt
  • CaptainRed
2D Artists: Sound Designer: Composer:
  • KiritoOmega97 (No Link)
Latest topics
» !!Migrating forum!! & Update - July 2015
by Tarazha Wed Aug 26, 2015 11:00 am

» SAO Suggestions
by Dante Emrys Sun Aug 09, 2015 9:10 am

» Introduce yourself here! :)
by DivineHope21 Sun Aug 09, 2015 4:22 am

» Owex's Creations
by DivineHope21 Sun Aug 09, 2015 4:04 am

» Noah Baker's Freelance Application/Specs
by Glavus Sun Aug 09, 2015 2:39 am


[Tutorials] Learn C#

View previous topic View next topic Go down

[Tutorials] Learn C#

Post by Joeybbb on Fri Apr 18, 2014 11:00 pm

Hey guys, rather than typing up a bunch of information about the whys, hows, and whats, watch the first video for a bit of explanation. I wanted to make sure I'm still posting things, even though there are fewer updates for SAO.

I've recorded a few episodes so far, but Ill wait before I get to deep into things and see how the poll turns out.


3D Platformer:
Episode 1:


Episode 2:


Episode 3:


Episode 4:


Episode 5:


Episode 6:


Episode 7:


Episode 8:


Episode 9:


Episode 10:


Episode 11:


Episode 12:


Episode 13:


Episode 14:


Episode 15:


Episode 16:


Episode 17:


Episode 18:


Episode 19:


Episode 20:


Episode 21:


Episode 22:


Episode 23:


Episode 24:


Episode 25:


Episode 26:


Episode 27:


Episode 28:


Episode 29:


Episode 30:



Line of Sight:

Episode 31:


Episode 32:


Episode 33:


Episode 34:


Episode 35:



Code:
using UnityEngine;
using System.Collections;

public class OverlayManager : MonoBehaviour
{
    public Weapon[] weapons;
    public Weapon currentWeapon;

    public Texture2D black;

    private Rect r;

    Vector2 mousepos;

    public bool allowInput = true;

    float currentRecoil = 0;

    void OnGUI()
    {
        r = GetMouseRect();

        GUI.DrawTexture(r, currentWeapon.overlay, ScaleMode.StretchToFill, true);
        
        r.xMax = r.xMin;
        r.xMin = 0;

        GUI.DrawTexture(r, black, ScaleMode.StretchToFill, false);

        r.xMin = r.xMax + currentWeapon.overlay.width;
        r.xMax = Screen.width;

        GUI.DrawTexture(r, black, ScaleMode.StretchToFill, false);

        r.yMin = r.yMax;
        r.yMax = r.yMin + currentWeapon.overlay.height;
        r.xMin = 0;
        r.xMax = Screen.width;

        GUI.DrawTexture(r, black, ScaleMode.StretchToFill, false);

        r.yMax = r.yMax - (currentWeapon.overlay.height*2);
        r.yMin = 0;

        GUI.DrawTexture(r, black, ScaleMode.StretchToFill, false);
    }

    private Rect GetMouseRect()
    {
        float x = mousepos.x - (currentWeapon.overlay.width / 2f);
        float y = Screen.height - mousepos.y - (currentWeapon.overlay.height / 2f);

        return new Rect(x, y, currentWeapon.overlay.width, currentWeapon.overlay.height);
    }

    void Start()
    {
        Screen.showCursor = false;
        Screen.lockCursor = true;
        currentWeapon = weapons[0];
        r.center = new Vector2(Screen.width / 2, Screen.height / 2);
    }

    void Update()
    {
        InputManager();
    }

    private void ShootManager()
    {
        if (Input.GetButtonDown("Fire1") && allowInput)
        {
            AudioSource.PlayClipAtPoint(currentWeapon.fireSound, transform.position);

            RaycastHit[] hits = Physics.RaycastAll(camera.ScreenPointToRay(mousepos));

            foreach (RaycastHit hit in hits)
            {
                IDamagable d = hit.collider.GetComponent<IDamagable>();
                if (d != null)
                {
                    d.DoDamage();
                }
            }

            StartCoroutine(Rechamber());
        }
    }

    IEnumerator Rechamber()
    {
        allowInput = false;

        float t = Time.time;

        bool played = false;
        float time = Time.time - t;

        r = GetMouseRect();
        float wantedY = r.yMin + currentWeapon.recoil;
        float difference = wantedY - r.yMin;

        while (time < currentWeapon.rechamberTime)
        {
            yield return null;

            time = Time.time - t;

            if (time < (currentWeapon.rechamberTime / 2f))
                currentRecoil = (difference * (time / currentWeapon.rechamberTime) * 2);
            else
                currentRecoil = (difference - (difference * (time / currentWeapon.rechamberTime) * 2));

            if (time > 0.5f && !played)
            {
                played = true;
                AudioSource.PlayClipAtPoint(currentWeapon.boltBack, transform.position);
            }
        }

        currentRecoil = 0;

        AudioSource.PlayClipAtPoint(currentWeapon.boltUp, transform.position);

        allowInput = true;
    }

    private void InputManager()
    {
        if (allowInput)
        {
            mousepos.x += (Input.GetAxis("Mouse X") * currentWeapon.sensitivityScalar);
            mousepos.y += (Input.GetAxis("Mouse Y") * currentWeapon.sensitivityScalar);
        }

        mousepos.y += currentRecoil;

        ShootManager();

        if (Input.GetKeyDown(KeyCode.Escape))
        {
            Screen.showCursor = true;
            Screen.lockCursor = false;
            allowInput = false;
        }

        if (Input.GetMouseButtonDown(0))
        {
            if (Screen.showCursor)
                Screen.showCursor = false;
            if (!Screen.lockCursor)
                Screen.lockCursor = true;
            allowInput = true;
        }
    }

    void OnDrawGizmos()
    {
        Gizmos.color = Color.red;

        Gizmos.DrawRay(camera.ScreenPointToRay(mousepos));
    }
}

Episode 36:


Episode 37:


Episode 38:


Episode 39:


Episode 40:


Episode 41:


Episode 42:


Episode 43:


Episode 44:


Episode 45:


Episode 46:


Episode 47:


Episode 48:


Episode 49:


Episode 50:


Episode 51:


Episode 52:


Episode 53:


Episode 54:


Episode 55:


Episode 56:


Episode 57:


Episode 58:


Episode 59:


Episode 60:


Episode 61:


Episode 62:


Episode 63:


Episode 64:


Episode 65:


Episode 66:


Episode 67:




Last edited by Joeybbb on Wed May 21, 2014 9:39 pm; edited 21 times in total (Reason for editing : Episode 67 Uploaded)
avatar
Joeybbb
Admin

Posts : 327
Join date : 2013-12-12
Age : 18
Location : USA

View user profile http://joeyq-games.site50.net

Back to top Go down

Re: [Tutorials] Learn C#

Post by Owex on Sat Apr 19, 2014 12:49 am

I've tried many times to learn programming, started with Python (which is supposed to be very simple), HTML, C#.... but I never succeeded to learn a language. Hope your approach will help me Smile

_________________
"Never trust time, it will let you down at the last minute." -me
Skills: Music, 3D modelling, Drawing and other stuff.

If you need help for anything, contact me by PM.
avatar
Owex
Admin

Posts : 307
Join date : 2013-12-11
Age : 20
Location : Canada

View user profile

Back to top Go down

Re: [Tutorials] Learn C#

Post by Joeybbb on Sat Apr 19, 2014 9:09 am

I've had pretty good success with making tutorials in the past, I'm hopeful :Dalso, it's easy considering if you have any questions you can just ask me on Skype xD Also, what sort of game/program would you want to make?

_________________
Awakened Studio Co-Founder

Follow me on Twitter @JoeyQuinto Smile

"Squashing bugs like bad habits!" -Me

Fast cars and shooting stars
avatar
Joeybbb
Admin

Posts : 327
Join date : 2013-12-12
Age : 18
Location : USA

View user profile http://joeyq-games.site50.net

Back to top Go down

Re: [Tutorials] Learn C#

Post by Ritvik on Sat Apr 19, 2014 2:57 pm

Thanks, joey, I too have the same case as Owex here, I could never learn a language, yes it does seem a little bit too complex to me. I really do think that if I follow your videos, then most probably ill be able to code too.

Ritvik

Posts : 32
Join date : 2014-03-01
Age : 17
Location : Canada

View user profile

Back to top Go down

Re: [Tutorials] Learn C#

Post by Joeybbb on Sat Apr 19, 2014 3:05 pm

Ok sounds great Very Happy What sort of game would you guys like to see built?

_________________
Awakened Studio Co-Founder

Follow me on Twitter @JoeyQuinto Smile

"Squashing bugs like bad habits!" -Me

Fast cars and shooting stars
avatar
Joeybbb
Admin

Posts : 327
Join date : 2013-12-12
Age : 18
Location : USA

View user profile http://joeyq-games.site50.net

Back to top Go down

Re: [Tutorials] Learn C#

Post by Owex on Sat Apr 19, 2014 11:37 pm

Maybe a platform game could be a good start.

_________________
"Never trust time, it will let you down at the last minute." -me
Skills: Music, 3D modelling, Drawing and other stuff.

If you need help for anything, contact me by PM.
avatar
Owex
Admin

Posts : 307
Join date : 2013-12-11
Age : 20
Location : Canada

View user profile

Back to top Go down

Re: [Tutorials] Learn C#

Post by Joeybbb on Sun Apr 20, 2014 5:59 pm

Heh too easy, platformer motion and jumping done Wink I plan on pumping out a few videos to get started so you guys aren't waiting around for a new video all the time, so I can make them as I want after that slower.

_________________
Awakened Studio Co-Founder

Follow me on Twitter @JoeyQuinto Smile

"Squashing bugs like bad habits!" -Me

Fast cars and shooting stars
avatar
Joeybbb
Admin

Posts : 327
Join date : 2013-12-12
Age : 18
Location : USA

View user profile http://joeyq-games.site50.net

Back to top Go down

Re: [Tutorials] Learn C#

Post by Joeybbb on Thu Apr 24, 2014 10:30 pm

Updated, with a new poll. For some reason I couldn't reset the poll ballots so it looks like option one has 3 votes already lol, however, I set multiple votes allowed to true so if that's not what you wanted then you can recast your vote.

_________________
Awakened Studio Co-Founder

Follow me on Twitter @JoeyQuinto Smile

"Squashing bugs like bad habits!" -Me

Fast cars and shooting stars
avatar
Joeybbb
Admin

Posts : 327
Join date : 2013-12-12
Age : 18
Location : USA

View user profile http://joeyq-games.site50.net

Back to top Go down

Re: [Tutorials] Learn C#

Post by Joeybbb on Sat May 03, 2014 4:50 pm

With the last addition of a power-up system, our 3D platformer basic functionality is now complete!

I've decided to move onto a new project so we can talk about some new concepts: Enter, Line of Sight!

The goal for this next project is to have a webplayer game where you play as a stick sniper, similar to so many other flash games.

_________________
Awakened Studio Co-Founder

Follow me on Twitter @JoeyQuinto Smile

"Squashing bugs like bad habits!" -Me

Fast cars and shooting stars
avatar
Joeybbb
Admin

Posts : 327
Join date : 2013-12-12
Age : 18
Location : USA

View user profile http://joeyq-games.site50.net

Back to top Go down

Re: [Tutorials] Learn C#

Post by Sponsored content


Sponsored content


Back to top Go down

View previous topic View next topic Back to top

- Similar topics

 
Permissions in this forum:
You cannot reply to topics in this forum