moose-mousse - Electronic Moose
Electronic Moose

Helloooo! I am Moose! They/Them/He/Him I am a embedded software engineer with autism, depression and anxiaty ( Wooo! ). I post about... whatever I want... software things, mental health things... whatever I feel like Feel very wellcome to send me asks about... anything that strikes your fancy :3

266 posts

When To Add Delta In GoDot?

When to add delta in GoDot?

So I am slowly eating my way though the tutorial for GoDot. I already have some experience with moving things in space and calculating inputs for individual objects.... That is essentially half of robotics software. So in every frame, a function called _process is called. this function takes a number called "delta", which is the amount of time passed since last frame ins seconds (Usually close to 1/30 or 1/60). You add delta to the calculation of certain variables. The first example usually found is position, which is done like so:

position += velocity * delta

To me that was all good and obvious. But I found a lot of posts of people being confused when to multiply delta and when not to. And apparently doing it in wrong places is a quite common bug in GoDot games. Here is to figure it out! Think in term of units

Velocity is distance/time Position is distance

So you cannot add velocity to position. They are 2 different units. How to fix this? Remove the time component.

Since time is distance is divided by time, we simply multiply time onto it. You know what have the unit of time?

delta is time

Meaning it is obvious why you need delta in the line! :D position += velocity * delta

Because distance += distance / time * time

  • 20mice
    20mice reblogged this · 1 year ago
  • blackblooms
    blackblooms liked this · 1 year ago
  • ladyargento
    ladyargento reblogged this · 1 year ago
  • ladyargento
    ladyargento liked this · 1 year ago
  • quietmarie
    quietmarie liked this · 1 year ago
  • frog707
    frog707 liked this · 1 year ago
  • hydralisk98
    hydralisk98 liked this · 1 year ago
  • mbvisualarts
    mbvisualarts reblogged this · 1 year ago
  • mbvisualarts
    mbvisualarts liked this · 1 year ago

More Posts from Moose-mousse

1 year ago
[Source]

[Source]

1 year ago

Denmark... is a elitist, right wing country

( Trigger warning, if you do not wish to hear about my political posts, blacklists the tag Danish Politics") So I am a Dane. And weirdly enough for my atheist, polyamorous self, I actually do want to be proud of my nation. And I AM, of several things Denmark have done... But overall? No. Denmark have widespread corruption ( A test in the spring of 2023 of "Who is willing to take bribes if we offer them 50k DKK (About 7.5k USD)" had 91% of politicians in parliament saying yes please) but a lot of the success of Denmark is based on what people THINK of Denmark, rather than what it actually is. For example, I finished university currently. And not only did the Uni teach students a way of doing databases that was in direct breach of GDPR (I documented this, and still have it all, since at the end of my education, I did not trust the university at all), but in at least 4 classes, the teacher did not bother to define what the students had to do to pass. In my robotics class, our final papers definition was "It must be 5 pages". That was it. No topic, no focus, no anything. You could still fail, but the requirements was inside a professors head, and you had to guess. If you ask the universities they will tell you that they received basically no complains. They forget to mention that there is no way TO complain. Despite this completely incompetent behavior, people having a danish education is thought of as high level. Because we used to be. Basically anything good you hear of Denmark, is inertia from its behavior in the 1990s (30+ years ago). Today it is a corrupt, right wing extremist state like so many other disappointments. We still have rights, but they are getting removed. And the majority of Danes do not care. They are busy yelling their sympathies to Israel.


Tags :
1 year ago

OMG I LOVE IT!

What is the dumbest thing you have coded and gotten to work?

a discord bot in my friend group server where it would scold people if they swore XD

What Is The Dumbest Thing You Have Coded And Gotten To Work?

An example hehe

1 year ago

Hmmmm.... I would have to do some math to be sure, but you usually write 0x to indicate hex ( 0b for binary).

So 0n66537... I would guess meaning it is in base 66537, or maybe base 66?

Which would run you out of letters of the alphabet... So what if each number character is represented with 2 characters?

So 10 would mean 1 but 11 would mean 1 + (26+9). So 36

Maybe?

Hex 0n66537uyyx9lyv12kypxmnaku5ch2fe4khvfxemu24y5uih2oext7437v82fwuiqkhu40m1jeey9zjvn34vn7i72lcpuopl0jcyf8ak394u0x0xt6yc9mxylbiwsj36sttut00pqhtjtlz2d8ur9ljaetingeaqi4z4xpn4785n69ymxi1gby4f8jgetm8n28uy23h9kcgukpetibd2b4f9cxhxqx0ptmyj1p2crbb4mclksraugkwo1lpteaoroxk1li6hx6r03wudisu9mkzcmc29wbixyyle81yxejwmuvhbs7jfr5q69o6pwbt259upwc7cdpa6l16xyh4m5lrn39bb9478kv9o6jrzgna1bj5ak449e8arxdto4cvnp7nof2gmb9eyxexrop351ojqbb8nf76nh8okh69pjea81el0khxngckwlqt5qh41i6gbvw5fuk2nuew5ix98b2azf621d61knkhfetrfvnbsojk3ushi3hm4uxwyf7l16t549ngp3wuibzxgp8tv729vi1ys0ydsipx7b7yxeqvpjv12se2iv938sstiq6uzoziuc7sn6qi9c14e4hmxgzh2iz8gzt8307mhlrgu58ka0opa5rcix93wk7qhiad04mruweg196zgn58rsmkcuimetzv9i3b6bhn0ft9wuf1h8riq96xbg28fvj99bjy6ms7fblrwizu4elt9r9a76myrcvkt7z9epo7fp3s3icyqeq4l6l3t7hyec2k9ft1cpmm2aqa4itflg6a325rdkb0n3rhdeyadpox277tag16o2zdnunhunp6m6gh0fpqfa3dzx22tjxx59ztlue2t7wwm61ahtxwxp6g8j72yd2k6div2vjg4z366rvsnvpm1rad07g2lkfbz20x5bxcg3thdo3jmpg2fld4ny7wyb7kmfdavs9kbeg55n09b3gl3tmepw2m6w0neor3pz713rtt5sc24jfnybuunpwc3jo627wr7dveyixb9pase7pb1klracijr5j3fccyyvg27nbaykbpf83zcjikxcsjj34no83mtm52jh64wccbh0553nqycwzmq8jsz9hznx9tzym8p1jbp99en59i6gsq2fjknay0mxzugobmdxn97ovl4mj9jy2sp6bh53toaxuxgef64k73m1866m4os5zjouuz82vnypn9pp9ttx3jvbh9iutr3vl3usveiuxikgth3slf5g1owbp4ta8ih2eaeyp039oxqu4ogq01izc7hkmg6r6epycb2fcjpxhz51wnr4f7c3o67gow26nz57ubztrc92zs9ajpx3mkqt02hp7bkcc40kz1p7dsy6oy05g0tcoqcrazg3mb3afin7eg3edg572u4346vevst3hr09vw6jr4btrqwu26wali6wz43cwqi610cmjtopsdztn85grare1aprxol978fbgostwyjlrj92k6xcsu0zqq8hns8pwaliqxd3jm8n3j73n0zy8ey870ynpwankg3pylr2qdi0eavvyx4mtx0xsiro8s75kzx9vmvv0nlraikvwunbo4hybsrevdi83etgrg9p1p3n0rgxsect9vam5tiuip6dn9pzrg5hy5zpzjiqc9x5ohbo5qnbp8dccjli7r7vskhgmajmvfczjit8cbcdhwms16tkjt3b1i8rndlcn528y4vd8it0txcwg41w6q6bth36ljn4x2o44zc9wga52rdzhz03h68ughkgrcbq7ik1hmqbrzookj4ljuus0e1hj8ljlt6onmxozxtn48g6t00zaxmxfb2y4oky4w1xe1j7cwrac4xqkfujxldbz1zvyn43bcfh6e4two9bpe1sifusb8bol6j8rau26tuvfza05r6941xk1c3qgjf2uinsq3ps9kdxie5cx1o8cwhw4l4ikev6yc7q18yyz2ocn7m0cuo7eytomxswz0v732dbribuagbq5cez4f3xrlmk411wts3v9dio8r23gr8uky3kqar1iyy4lojsqjtzs49gg3ptkij1lcbvksr83tk7yc357w95hinfm3bukngqnsu6v8zcn9dt55cpjul7c7fl152t4cbzvpd2adqmbg6wjhqij2vmf5nglv5xi5kwfz4uys5segniu3pyva8fjj7ttsgr9kujf0irxkopueg29ztue2gn733rrd81byp1m7waqhm6b6s1t5jl03ku7k5xrkhi0kd5juaumq26wy8syaw0e4km77qoyw1qkkyv9i8q93i703m0bka4mnflqqcfah6y8ph40x4z36nokd5tt00hxf3dm491ekj64s0ahsgaswyl4i55tepzxutkey4xdrdxy6p9ylgk60pbheygq6198tk25uqkwrbjqqp2o2llwkjpsia7yh4kxd2hiw9euvv1e2pnousxvvs5lk4pxt8ha28tmwjsl5yi6rbfl93snaxe7mpbl41z35xmg2q5nno0t886sx2gisallh7npxkci7fic7cukg68nun6ajf0nhc7jblnvbzoqafqdqqzczk9x6dofbejmdahikl5az3yr1oxndyk5kzaxvnifav0ts88snn402hsu8kob81qnzhuxokwo0raqgnh6wyfsn6ssbmu9jd2uijb4pgfcs4f1wpv7l4w6jmwzkmdrc9wqtptcxfnj5g4uvlaxjjb18bzk7kcabf4cyi1jpwkez9uex7jp7px3a19bv5m3ek4fhnsuc9jpmqkry3qzklvk2tsskvde2x3x7yih79zpfggo67y0e8i9ikfv4muqufyvqm861g08xgh4woou132flzyj8dnk7wmps7nstu6q9f33gfwdsfusuokzoc1fui716b7809welruen45f8z0ici3pnkirdhwl7xr732gee7exbgx0ynl56cx6y07jjc3r90qd0e7hll4wwt9brax7d1s2r4kae24z2hnw6dsfjgkth0srwhus8iaw7xlw8kascd0cyj7odch72myq78lmgkfwmsy2t587oihz13e16h5qzdp63njm1ffg1qvb3bajswgq6ygfnrzsuvmmgrl64udkhb2dg2f0vhe2le3kff65277kldamnf4wvwkwphfcw91pnrnw17tl5fykizj45bn4gknpclhxfyw4kr4uxrsxgvtlzw3qewbs9ywt15s9mc6nssfs6red3os07oehwsehgdml7f29yl5j26i9rdnv5sjj08ypgvg4 w1 s2 v27

am i doing something wrong? i somehow can't decode this from hex

1 year ago

You made me wake my dog up from laughter! :D

programmers will complain about how C++ is too complicated or arcane or whatever and then will literally go and write in JavaScript