🎉 Celebrating 25 Years of GameDev.net! 🎉

Not many can claim 25 years on the Internet! Join us in celebrating this milestone. Learn more about our history, and thank you for being a part of our community!

Weekly update #24

Published July 24, 2017
Advertisement

UI: character menu & build mode panel Domen Koneski

Continuing with the UI, I have decided to implement a brand new character menu that includes all the player stats, player model and item slots for your dressing needs (will be implemented in the future). You can rotate your player model with the script that is provided below.

character_menu_ui_lowpoly_floatlands.png
New character menu

I have also changed the looks of the Build mode to make it as simple as possible.

ui_buildmode_lowpoly_floatlands.png

New build mode outlook

 

Generic mouse swipe script Domen Koneski

It is time to give away some code for those in need of a solution when you want to do something with the mouse gestures, in this case a mouse “swipe” gesture, e.g. you wish to rotate your character model in the character menu with your mouse. The script provided can be used in your projects, free of charge, and can handle multiple things:

  • Unity Event when moving the mouse in X direction only
  • Unity Event when moving the mouse in Y direction only
  • Unity Event when moving the mouse in XY direction
  • Knowing if the mouse is “down” on the selected raycastable panel

To make things work create a UI panel, hide the image (do not disable the component), select the image as raycastable and add this script. What you have to do now is to populate your Unity events with your custom function calls. Do not forget when calling your function via this script the function getting called must take one (for X or Y only events) or two (XY event) arguments type of float. The last thing is to mark the event as dynamic, see image below.

mouse_swipe_script_lowpoly_floatlands.pn
mouse swipe script


using UnityEngine;
 
using UnityEngine.Events;
 
using UnityEngine.EventSystems;
 
namespace Floatlands.UI
{
    public class MouseSwiper : MonoBehaviour, IPointerDownHandler, IPointerUpHandler
    {
        public bool isHoldingDown;
        public Vector2 totalDeltaVector;
        public Vector2 deltaVector;
        private Vector2 prevVector;
 
       private Vector2 startPosition;
        private PointerEventData eventData;
 
       [SerializeField]
        public SwipeSingleEvent OnSwipeXEvent;
        [SerializeField]
        public SwipeSingleEvent OnSwipeYEvent;
        [SerializeField]
        public SwipeDoubleEvent OnSwipeXYEvent;
 
       public void OnPointerDown(PointerEventData eventData)
        {
            isHoldingDown = true;
            startPosition = eventData.pressPosition;
            prevVector = startPosition;
            this.eventData = eventData;
        }
 
       public void OnPointerUp(PointerEventData eventData)
        {
            isHoldingDown = false;
        }
 
       void Update()
        {
            if (isHoldingDown)
            {
                Vector2 currentPosition = this.eventData.position;
                totalDeltaVector = currentPosition - startPosition;
 
               deltaVector = currentPosition - prevVector;
 
               prevVector = currentPosition;
 
               OnSwipe((int)deltaVector.x, (int)deltaVector.y);
            }
            else
            {
                totalDeltaVector = Vector2.zero;
            }  
       }
 
       void OnSwipe(int deltaX, int deltaY)
        {
            if (OnSwipeXEvent != null)
                OnSwipeXEvent.Invoke(deltaX);
            if (OnSwipeYEvent != null)
                OnSwipeYEvent.Invoke(deltaY);
            if (OnSwipeXYEvent != null)
                OnSwipeXYEvent.Invoke(deltaX, deltaY);
        }
    }
 
   [System.Serializable]
    public class SwipeSingleEvent : UnityEvent<int> { }
    [System.Serializable]
    public class SwipeDoubleEvent : UnityEvent<int, int> { }
}

 

Outfits and speakers Andrej Krebs

Mito created some outfits concepts for “techies” that would distinguish them from the “farmers”. So this week I was occupied with modeling and weight painting the new outfits. They put more metal pieces on themselves as armour is made of junk pieces of sheet metal.

techies_outfits_lowpoly_floatlands-1.png
various “techies” outfits

After that I modeled propaganda speakers, which will appear in the world. The speakers will emit propaganda messages and other sounds.

propaganda_speakers_lowpoly_floatlands.p

propaganda speakers

 

Extra robot concepts Mito Horvat

Currently there is only one type of enemy robots. Simple humanoid machines that wield various weapon types (from snipers to grenadiers etc), they roam around and attack anything in sight. In the near future we’ll add sturdy, hard to destroy robots that will challenge the player. In addition, we’ll also add small spider like robots that will be quick and unforgiving with their melee attacks. Those enemies will surely test your aim. You can see the first glimpse of concept sketches below.

enemy_robots_concepts_lowpoly_floatlands
a different kind of enemy robots

 

Mining drone in action tadej vranesic floatlands

This week I’ve been playing around with drones, particularly “mining” drone which Andrej beautifully modeled. Mining drone will represent a fine touch to resource collecting. Upon destruction its loot will be dropped and ready for collection, which allows the player to gather resources faster. Tweaking its avoidance system makes it fly smootly regardless of any obstacles on its path. Finishing touches were also made for the drill rotation. More nuts and bolts next week.

mining_drone_active_lowpoly_floatlands.g
mining drone in action

NPC battles vili ikona

Humans are already alive and fighting each other (Farmers vs. Techies). They have 3 different weapons for now: fists, single shot pistol and revolver. They can also melee attack with pistols!

NPC_fighting_lowpoly_floatlands.png
NPCs fighting

I also just started working on ‘Hint nodes’, which will have different geometric shapes. Those hint nodes will provide information about the world – safe spots, danger spots, sniper spots and so on.

basic_gizmos_lowpoly_floatlands.png
basic gizmos


More about Floatlands: website, facebook, twitter, instagram

Previous Entry Weekly update #23
Next Entry Weekly update #25
2 likes 1 comments

Comments

Eck

Wow, that's looking really nice.

July 29, 2017 05:58 PM
You must log in to join the conversation.
Don't have a GameDev.net account? Sign up!
Advertisement