basic saves the day
#1
My son is programming in an implementation of smalltalk and is working on a game where he has to keep track of world space and camera space and wanted to do a simple angle based system a shooter fires at a target and he hasn't studied trigonometry yet.  Dad to the rescue!  He was mixing up World space and camera space variables but that was fairly easy to spot. I showed him the proper formulas for calculating the difference in coordinates along angles but it wasn't working right for him so I showed him how it worked in QB64. It still wasn't working right for him and it took almost 2 hours of troubleshooting before I realized...doh.. "even though the internal logic of your programming language uses degrees it automatically converts to radians when doing trigonometry" . Luckily I had my little program to show the centuries old math is right. It was just a matter of figuring out which way his programming language thought 0 degrees was and figuring out the lag between object creation and when the angle between two objects was actually reported.

Being able to demonstrate the math in basic thanks to QB64 was the winner.
Reply
#2
(05-28-2023, 04:21 PM)James D Jarvis Wrote: My son is programming in an implementation of smalltalk and is working on a game where he has to keep track of world space and camera space and wanted to do a simple angle based system a shooter fires at a target and he hasn't studied trigonometry yet.  Dad to the rescue!  He was mixing up World space and camera space variables but that was fairly easy to spot. I showed him the proper formulas for calculating the difference in coordinates along angles but it wasn't working right for him so I showed him how it worked in QB64. It still wasn't working right for him and it took almost 2 hours of troubleshooting before I realized...doh.. "even though the internal logic of your programming language uses degrees it automatically converts to radians when doing trigonometry" . Luckily I had my little program to show the centuries old math is right. It was just a matter of figuring out which way his programming language thought 0 degrees was and figuring out the lag between object creation and when the angle between two objects was actually reported.

Being able to demonstrate the math in basic thanks to QB64 was the winner.

Love these kinds of stories !  Good stuff.
Reply
#3
+1 Way to go James! Smile
b = b + ...
Reply
#4
hmmm so he use this;
https://squeak.org/

or there is more?
Reply
#5
(05-28-2023, 07:31 PM)aurel Wrote: hmmm so he use this;
https://squeak.org/

or there is more?

https://cuis.st/

https://pharo.org/

https://www.exept.de/en/smalltalk-x.html

... and much more,

see https://en.wikipedia.org/wiki/Smalltalk
Reply
#6
Scratch I believe.  

I keep encouraging him to go wider but he likes have so much graphical functionality built in. He did write his first computer game at 6 and the scripting that used was very pretty-much C so I still have hopes. It took me a few minutes all those years ago to explain grid coordinates and simple replacement algebra to him.
Reply




Users browsing this thread: 6 Guest(s)