Welcome, Guest. Please login or register. Did you miss your activation email?

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - TheYoungGeek43

Pages: [1]
1
DotNet / Re: Input detect once
« on: October 07, 2018, 01:36:32 pm »
Sure sorry
OnKeyPressed function
        private void OnKeyPressed(object sender, KeyEventArgs e)
        {
            Window window = (Window)sender;
            window.SetKeyRepeatEnabled(false);
            if (e.Code == Keyboard.Key.A)
            {
                Console.WriteLine("Bou");
            }
        }
 

Update function
private void Update()
{
            _window.Closed += new EventHandler(OnClosed);
            _window.KeyPressed += new EventHandler<KeyEventArgs>(OnKeyPressed);
            _window.SetFramerateLimit(60);
}
 

The Update function is call when i do the while window.isOpen

Thanks

2
DotNet / Re: Input detect once
« on: October 06, 2018, 08:53:50 am »
Hello

I write the
            window.SetKeyRepeatEnabled(false);
 
But this don't work i try to write in the Update, in the constructor of my main class, in my function OnKeyPressed and in my function for create my window but this line don't work :/

Where i write i don't find.

Thanks and sorry :/

3
DotNet / Re: Input detect once
« on: October 05, 2018, 03:02:33 pm »
Ok but if i want detected the repeat i can't
Because i wan't to detected once for the attack but for the move i want detected always :/

4
DotNet / Re: Input detect once
« on: October 05, 2018, 08:58:34 am »
Hello

I've surrend this idea but this week i take my revenche but i don't know how I can do this

I want detect just once the input for detect the input always is pressed i use
            _window.KeyPressed += new EventHandler<KeyEventArgs>(OnKeyPressed);
 
        private static void OnKeyPressed(object sender, KeyEventArgs e)
        {
            Window window = (Window)sender;
            if (e.Code == Keyboard.Key.A)
                Console.WriteLine("Hola");
        }
 

But i don't find for detect the input once

I'm french sorry for my english ;)

Thanks for your help ;)

5
DotNet / Re: Input detect once
« on: August 26, 2018, 10:05:23 am »
Hi
I've see that in internet but I don't understand where i initialize the Event in my main class i just this
                Window.DispatchEvents();
 
For the event

6
DotNet / Input detect once
« on: August 26, 2018, 09:38:41 am »
Hello

I've problem my problem is I want when player pressed the left button of mouse my game detect one clic not 3600 clic

Thanks for your help ;)

7
DotNet / Re: Error first project
« on: August 25, 2018, 09:46:06 pm »
I've test this moorning and i forget the c dll (csfml) ^^ thx

8
DotNet / Error first project
« on: August 24, 2018, 06:51:27 pm »
Hello,
I begin use SFML with C# and I've see a youtube video for display window but I have a error
(I use Rider)

This is the error

Unhandled Exception: System.BadImageFormatException: Could not load file or assembly 'sfmlnet-graphics-2, Versio
n=2.2.0.0, Culture=neutral, PublicKeyToken=null'. Tentative de chargement d'un programme de format incorrect.
   at French_Master_Game_Jam_1.Program.Main(String[] args)



 

MyCode
Program.cs
using System;

namespace FrenchMasterGameJam1
{
    class Program
    {
        static void Main(string[] args)
        {
            RPG game = new RPG();
            game.Run();
        }
    }
}

Game.cs

using SFML.Graphics;
using SFML.Window;

namespace FrenchMasterGameJam1
{
    public abstract class Game
    {
        protected RenderWindow window;
        protected Color clearColor;
       
        public Game(uint width, uint height, string title, Color clearColor)
        {
            this.window = new RenderWindow(new VideoMode(width, height), title, Styles.Close);
            this.clearColor = clearColor;
        }

        public void Run()
        {
            LoadContent();
            Initialize();
            while (this.window.IsOpen)
            {
                this.window.DispatchEvents();
                Update();
                this.window.Clear(clearColor);
                Render();
                this.window.Display();
            }
        }

        protected abstract void LoadContent();
        protected abstract void Initialize();

        protected abstract void Update();
        protected abstract void Render();
    }
}
 

Main.cs

using SFML.Graphics;

namespace FrenchMasterGameJam1
{
    public class RPG : Game
    {
        public RPG() : base(600, 800, "Test", Color.Blue)
        {
           
        }

       
        protected override void Initialize()
        {
        }
       
        protected override void LoadContent()
        {
        }

        protected override void Update()
        {
        }

        protected override void Render()
        {
        }
    }
}
 

I have look all dll (SFML) is copied in the debug directory

Thanks for help

9
Java / Collision
« on: August 03, 2014, 04:53:50 pm »
Hi,

I would like to know how to make games with a collision on JSFML

thank you to explain me with code


----------------------------------------------------------------------------------------------------------------------------------------------
I'm French

Pages: [1]