|
Goombert
|
|
Reply #1 Posted on: September 03, 2013, 01:57:09 pm |
|
|
Location: Cappuccino, CA Joined: Jan 2013
Posts: 2993
|
Well neither Game Maker or ENIGMA provide this behavior by default. But you raise an interesting suggestion of something could be implemented. But for now just do as it would be done in Game Maker, eg. create a variable mouse_left_clicks = 0; in the create event and everytime the mouse left button occurs or you check it with mouse_check_button(mb_left); just do this mouse_left_clicks += 1; and then...
if (mouse_check_button(mb_left) && mouse_left_clicks >= 2) { mouse_left_clicks = 0; // do stuff }
But ya, like I said we should look at maybe how we could implement this to ENIGMA to make it easier.
|
|
|
Logged
|
I think it was Leonardo da Vinci who once said something along the lines of "If you build the robots, they will make games." or something to that effect.
|
|
|
|
|
AsherOS
|
|
Reply #4 Posted on: September 03, 2013, 02:05:41 pm |
|
|
Joined: Jul 2013
Posts: 19
|
That is something I will very much appreciate! Everyone's got their hands full these days.
|
|
|
Logged
|
|
|
|
TheExDeus
|
|
Reply #5 Posted on: September 03, 2013, 02:27:24 pm |
|
|
Joined: Apr 2008
Posts: 1860
|
Things that are easy to implement in EDL (like Robert's few lines of code shows) usually are not good things to actually implement in ENIGMA as this way you have a lot more control. Problem here being that it would have to be strictly "standardized" or outlined. For example, how long should the presses be counted? When should they be clear? When you press another button? But then you won't be able to run and activate the ability at the same time. If it clears based on time, then what time? And be measured in what? Probably steps, but then the default value would usually be unsuitable and a function to set this time would have to be used. Or it needs to be cleared on times (just like Robert code, so it works even in rapid succession), but setting this for all inputs would be hassle. So a manual control for count clearing would have to be used as well. So maybe this could be added as an extension to ENIGMA just in case someone wants a ready made (but probably less flexible) solution. So in the end it would probably take even more code to use that extension than to code your own.
Also, your example mentions xbox (or similar) controller. That in itself is an extension and it would be more complicated to add a system like this for other inputs which can be controllers. Especially if it is an extension.
So it would probably always take less time and be less of a hassle to code this yourself, but I guess we can consider this. Maybe I will make an extension like that for keyboard and mouse.
|
|
« Last Edit: September 03, 2013, 02:30:53 pm by TheExDeus »
|
Logged
|
|
|
|
|
|
Goombert
|
|
Reply #8 Posted on: September 03, 2013, 04:35:30 pm |
|
|
Location: Cappuccino, CA Joined: Jan 2013
Posts: 2993
|
Harri, I was thinking of maybe some way to abstract the events was all, not suggesting implementing a counter when its never used.
AsherOS, we do have an XInput extension I wrote though, you can hook up and use your Xbox 360 controller if you have one, joysticks are also implemented, without extension on Linux but on Windows you enable DirectInput.
|
|
|
Logged
|
I think it was Leonardo da Vinci who once said something along the lines of "If you build the robots, they will make games." or something to that effect.
|
|
|
|
Goombert
|
|
Reply #10 Posted on: September 04, 2013, 04:32:28 pm |
|
|
Location: Cappuccino, CA Joined: Jan 2013
Posts: 2993
|
Yes, that would be possible but a 1000x more work than just doing our various ports. We plan to do ports to Android and stuff but we need our new compiler finished first so that it can export using pretty printers to JavaScript/HTML5 etc.
|
|
|
Logged
|
I think it was Leonardo da Vinci who once said something along the lines of "If you build the robots, they will make games." or something to that effect.
|
|
|
|
|