Giter Site home page Giter Site logo

otter's People

Contributors

kylepulver avatar willsams avatar

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

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

otter's Issues

CS0649: Field 'ColorTween.hue' is never assigned to, and will always have its default value 0

Hi. I keep getting this error in the cache whenever I try to run the code below:
Internalerr
`using Otter;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace PlayerSessions
{
class PlayerSessions
{
static void Main(string[] args)
{
// Create a game
var game = new Game("Player Sessions");
// Name the game folder for exporting session data.
game.GameFolder = "PlayerSessionDemo";

        // Add a new session to the game for Player 1.
        var session = game.AddSession("TestPlayer1");

        // Import any data. If no data found, none will be loaded.
        session.Data.Import();

        // Load data, or set default values.
        // Using strings for keys here, but you can also use Enums!
        session.Data.GetIntOrDefault("LevelsUnlocked", 0);
        session.Data.GetStringOrDefault("LeaderboardName", "Player");
        session.Data.GetBoolOrDefault("InvertedControls", false);
        session.Data.GetStringOrDefault("PlayerColor", "FF0000");
        session.Data.GetFloatOrDefault("StartPosition", 0.25f);

        // Export the data to a semi-encrypted file.
        session.Data.Export();

        // Configure the Controller for the player session.
        // Add a "Left" button
        session.Controller.AddButton("Left");
        // Set the button to respond to the A key.
        session.Controller.Button("Left").AddKey(Key.A);

        // Add a "Right" button
        session.Controller.AddButton("Right");
        // Set the button to respond to the D key.
        session.Controller.Button("Right").AddKey(Key.D);

        // Add a new session to the game for Player 2.
        session = game.AddSession("TestPlayer2");

        // Import any data. If no data found, none will be loaded.
        session.Data.Import();

        // Load data, or set default values.
        // Using strings for keys here, but you can also use Enums!
        session.Data.GetIntOrDefault("LevelsUnlocked", 0);
        session.Data.GetStringOrDefault("LeaderboardName", "Player");
        session.Data.GetBoolOrDefault("InvertedControls", false);
        session.Data.GetStringOrDefault("PlayerColor", "0000FF");
        session.Data.GetFloatOrDefault("StartPosition", 0.75f);

        // Export the data to a semi-encrypted file.
        session.Data.Export();

        // Configure the Controller for the player session.
        // Add a "Left" button
        session.Controller.AddButton("Left");
        // Set the button to respond to the Left key.
        session.Controller.Button("Left").AddKey(Key.Left);

        // Add a "Right" button
        session.Controller.AddButton("Right");
        // Set the button to respond to the Right key.
        session.Controller.Button("Right").AddKey(Key.Right);

        // Create a Scene.
        var scene = new Scene();
        // Add a Player Entity for each session.
        scene.Add(new Player(game.Session("TestPlayer1")));
        scene.Add(new Player(game.Session("TestPlayer2")));

        // Start the Game.
        game.Start(scene);
    }
}

class Player : Entity
{
    // Create a test image.
    Image image = Image.CreateRectangle(40, Color.White);
    // The Session that this Entity will reference.
    Session session;

    public Player(Session session) : base()
    {
        // Keep track of the Session passed in by the constructor.
        this.session = session;

        // Set the starting position.
        // Using Game.Instance here because the Entity doesn't have a reference to the Game yet.
        X = Game.Instance.HalfWidth;
        Y = Game.Instance.Height * session.Data.GetFloat("StartPosition");

        // Add the image.
        AddGraphic(image);
        // Center the origin of the image.
        image.CenterOrigin();
        // Set the image color from the Session data. 
        // Using a string for the key, but you can also use Enum!
        image.Color = new Color(session.Data.GetString("PlayerColor"));
    }

    public override void Update()
    {
        base.Update();

        // Use the Session controller to control the movement.
        // Using a string for the key, but you can also use Enum!
        if (session.Controller.Button("Left").Down)
        {
            X -= 3;
        }
        if (session.Controller.Button("Right").Down)
        {
            X += 3;
        }
    }
}

}`

Cross Platform

I've noticed one of the project goals is to make this cross-platform. A great way to achieve your goal is to target .Net Core and target the 2.5 version NuGet package of SFML.Net to get rid of the messy dlls. I've started a branch, hoping to get a pull request done by the end of the weekend.

Logical Namespacing

The Otter code should be, at least, logically namespaced based on the folders. I.e., Otter.OgmoPlayer() should be Otter.Utility.OgmorPlayer(). Would make things easier in the future to avoid code collision. Also, it would avoid some of the possible code collisions with SFML's namespaces. For example, Otter.Shader and SFML.Graphics.Shader.

Archive Otter.

Since you are no longer working on Otter, why don't you archive it? You have no notice on the GitHub page, but you do on the website.

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.