Spogg wrote:I’m so sorry but I can’t make this work tulamide. I know almost no Ruby though so I guess it’s not surprising
I have some questions:
@t += dt * @rate :
- dt is undefined in Ruby so I substituted fixed values, like 0.01, 0.1 etc but I suspect there’s more to it than that.
- What stops the above counter and why wouldn’t it carry on forever?
- dt is a small time increment added on every draw call. Does this mean on every screen refresh or only when a change of input maybe triggers a re-draw? If it’s the latter wouldn’t we again be dependant on green timing?
It would help me bigly if you could throw together a working demo so I could see where I’m going wrong and hopefully learn something.
Cheers
Spogg
Indeed it is not surprising. How do you think to understand a language, if you are not yet familiar with its syntax? That's like trying to speak German without ever having learned how a German sentence is constructed.
"My lovely Mr singing club"
Does this make any sense to you? Of course not. It is a German saying that I translated literally, word by word, without considering English syntax.
"Mein lieber Herr Gesangsverein"
Somebody from Britain had a few German lessons in school, but 20 years later, when we met, he couldn't remember much from it, and the few bits in his mind were additionally twisted. And so he said "Ich bin ein Spiegelei auf dem Boden". Now, this doesn't make any sense. It means "I'm a fried egg on the floor". Obviously he once had a lesson where somebody let fall a fried egg. But he couldn't remember the whole sentence and his mind filled in the gaps.
What I want to say is, learn the syntax first. How Ruby expects you to talk to it, and how Ruby will talk to you. Aspects like local-, global-, class- and class-instance-variables, constants, methods, arguments, the "everything is an object" concept.
Then you will be able to learn from other people's code.
The post I made was not about a fully featured, working example. It was about the principle. You could do the very same in green as well. Just the principles of time-based movement. So, of course it doesn't work right out of the box. I didn't see the need for code that doesn't deal with the principle of time-based movement, but with setting colours or drawing something.
Having said all that, I have made a (VERY SIMPLE!!) example. A fully working Ruby example (only tested in v3.0.6). I interrupted two works for other people on the forum (you know one of them), so I hope they don't get mad at me for the delay.
And Tiffy, I'm sorry for hijacking your thread. I hope you aren't angry and can learn from the example