Browse Search Popular Register Upload Rules User list Login:
Search:
One Hit Wonder

Image:
screenshot of the scene

Author: s_noonan

Group: Technical

Filesize: 24.06 kB

Date added: 2012-10-21

Rating: 5

Downloads: 367

Views: 322

Comments: 3

Ratings: 1

Times favored: 0

Made with: Algodoo v2.0.2 Edu

Tags:

Scene tag

The idea is all Xray's, but I have a simple mind and the scene's keyDown code made my head hurt a little bit. This scene code does the same thing as the scene's keyDown code, except the code is in only one object. It does one action instead of continuous action when a laser is activated.
Last edited at 2016/07/02 20:55:50 by s_noonan
Please log in to rate this scene
edit
This scene is a response to:
Title Author Rating Downloads Comments Date added
KEYBOARD DECODER - Prototype Xray 5 (1 vote) 259 1 2012/10/20 06:55:58
show grid
Nice job on your One Hit Wonder, but it appears to have many more limitations than my Keyboard Decoder scene. For one, you need to substitute the Shift key for the Spacebar. And for another, what good is cycling through numbers 0 - 9? How would you type in a number such as 279.53? Yes, I know that your scene is far from finished and needs a lot of work (like mine does) before it can be a completed functioning scene, but I don't see how yours can be any more useful than mine. :blink: Please explain.

By the way, in case you hadn't figured it out, the reason why I force Algodoo to continue to run in my scene is so that the Spacebar can be used to enter a SPACE character. Otherwise, Algodoo would stop running each time you hit the Spacebar!

Edit -- One more "By the way".... Those little boxses with the two lasers in them are a design by Kilinich. I needed a way to determine when a keyboard key was pressed and then subsequently released, and Kilinich suggested that method rather than using "keys.bind".
Last edited at 2012/10/21 19:31:46 by Xray
Xray,

This scene is concerned with just one aspect of your KEYBOARD DECODER scene, that is the code to do only one action when a laser is activated. The code to do this in the KEYBOARD DECODER scene resides in (4) objects and was difficult for me to follow. The One Hit Wonder scene contains two examples; one with all the code in the laser and a second example with all the code in a box. In both cases the code resides only in one object. I was not trying to recreate your scene. I just wanted to try simplifying one function.

Regarding your statements and questions:

S: It appears to have many more limitations than my Keyboard Decoder scene.
R: Yes. The scene is intended to address just one aspect.

S: You need to substitute the Shift key for the Spacebar.
R: Yes. I took the easy way out since I did not want to copy you and I could not improve on what you had already done.

Q: What good is cycling through numbers 0 - 9?
A: The demo shows how there is one action for each key hit. If you hold the key down indefinately, the number will not change. By the way, the numbers do not cycle 0-9, they continue to count up with each key press.

S: I don't see how yours can be any more useful than mine.:blink: Please explain.
R: The only usefulness I see is code simplification for the one function.

S: I force Algodoo to continue to run in my scene is so that the Spacebar can be used to enter a SPACE character.
R: That is what I figured, and it seems reasonable to me.

S: Those little boxses with the two lasers in them are a design by Kilinich.
R: So it was Kilinich who was making my head hurt. It wouldn't be the first time. He is a far more advanced programmer than I am.
s_noonan -Thanks for the explanations. It all makes sense now, and you DID do a great job of simplifying the keypress function. Simple is better (so says Occam). :)

Yes, Kilinich is highly educated and he has a lot of programming experience (I know this because he told me). I do have some previous programming experience but no where near the level that he's at. For what it's worth, much of his code makes my head spin too! :lol:

Again, nice job.