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

Author Topic: Changable keys ingame?  (Read 1792 times)

0 Members and 1 Guest are viewing this topic.

BaneTrapper

  • Full Member
  • ***
  • Posts: 213
  • Do you even see this, i dont need it.
    • View Profile
    • Email
Changable keys ingame?
« on: August 01, 2013, 09:12:33 pm »
Hello.
I believe this question has bean asked many times, but using search provides me with error asking me to contact admin...
Could someone point me to some post about changable keys ingame?
EX:
i will mose "W = north" "S = south" "A = West" "D = East"
how can i allow player to switch witch button calls witch effecet?
BaneTrapperDev@hotmail.com Programing, Coding
Projects: Not in development(unfinished/playable):
http://en.sfml-dev.org/forums/index.php?topic=11073.msg76266#msg76266
UP and in Development: The Wanderer - Lost in time
http://en.sfml-dev.org/forums/index.php?topic=14563.0

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Re: Changable keys ingame?
« Reply #1 on: August 01, 2013, 09:34:42 pm »
Quote
using search provides me with error asking me to contact admin...
Don't select all forums.
Laurent Gomila - SFML developer

ahnonay

  • Guest
Re: Changable keys ingame?
« Reply #2 on: August 01, 2013, 09:50:23 pm »

Yemeni Cpluspluser

  • Newbie
  • *
  • Posts: 25
  • C/C++, Soon Java and SQL ^_^
    • View Profile
    • Email
Re: Changable keys ingame?
« Reply #3 on: August 01, 2013, 11:19:54 pm »
save the key as a variable then tell the user to press the key for example for attack
as you can see each key has a specific value, store that value in your variable


    std::cout << sf::Keyboard::Key::Up;
    int userKeyUp = sf::Keyboard::Key::Up;

   

 
[/s]


its just I am not sure how to know which key pressed to take it to the variable



EDIT : check ahnonay post
« Last Edit: August 01, 2013, 11:31:31 pm by Yemeni Cpluspluser »
sf::signature mySignature;
mySignature.setPosition(forum.x,forum.y);
window.draw(mySignature);

 

anything