Hello Guest

Author Topic: Scene-Update?  (Read 1399 times)

0 Members and 1 Guest are viewing this topic.

Cross

  • Member
  • Posts: 4
    • View Profile
Scene-Update?
« on: October 04, 2015, 10:34:11 AM »
Hey,

when i try to catch an keyinput in the sceneupdate-function, nothing happens.

Code: [Select]
        public override void Update()
        {
            base.Render();
            if (Input.KeyPressed(Key.Space))
            {
                Game.SwitchScene(new MainMenu());
            }
        }

Regards,
Cross
« Last Edit: October 04, 2015, 10:43:14 AM by Cross »

Kyle

  • Administrator
  • Member
  • Posts: 258
    • View Profile
Re: Scene-Update?
« Reply #1 on: October 04, 2015, 12:36:34 PM »
Calling "base.Render()" in Update is probably doing something weird.

Cross

  • Member
  • Posts: 4
    • View Profile
Re: Scene-Update?
« Reply #2 on: October 05, 2015, 05:01:45 AM »
sry, i forgot to replace the .base.render-function with the base.update()

i checked the keyinput in the render-function, because the update-function doesnt work for me.


Kyle

  • Administrator
  • Member
  • Posts: 258
    • View Profile
Re: Scene-Update?
« Reply #3 on: October 05, 2015, 07:31:49 PM »
I'm not sure what to make of this as this code works for me:

Code: [Select]
        public override void Update() {
            base.Update();

            if (Input.KeyPressed(Key.Space)) {
                Console.WriteLine("aosidhf");
            }
        }