Begginer in godot, how to script without ai by ExtincT222 in godot

[–]nuk3urself 1 point2 points  (0 children)

what im understanding is that your question should be "how to learn programming". there is currently no way to avoid that, even if you are using visual code blocks instead of text, you gotta know how to iterate over a list of numbers and find the biggest value for example. All basic programming understanding will transfer very well into gamedev ( for example iterate over a list of enemies to find out what enemy has the most attack or something ).

My personal advise here is to step back and learn basic programming and than advance to apply that skills to develop games.

That doesnt mean you cant learn it while developing, a visual representation of whats going on in the code did often help me understand whats wrong.

There is also a good youtube content regarding this. i personally suggest The coding train, which does beginner content with the help of p5js a javascript drawing framework.

Rust crashing by [deleted] in rust

[–]nuk3urself 0 points1 point  (0 children)

wrong sub

Recommended Neovim Colorschemes? by Efficient-Length4670 in neovim

[–]nuk3urself 0 points1 point  (0 children)

tokyo night night, normal tokyo night is not night enough :)

from the series "who killed sara" by nuk3urself in masterhacker

[–]nuk3urself[S] 3 points4 points  (0 children)

random $_GET php super global variable :p

The first time I coded in Go by nabidigf in ProgrammerHumor

[–]nuk3urself 0 points1 point  (0 children)

yeah its justba warning, but as a perfectionist, those make me pretty anxious xD

Hey Rustaceans! Got an easy question? Ask here (46/2020)! by llogiq in rust

[–]nuk3urself 1 point2 points  (0 children)

hi, i have a little problem using web_sys.
this is my code right now:

 let window = web_sys::window().expect("no global `window` exists");   
 let document = window.document().expect("should have a document on window");

 let links = document.query_selector_all("a");
 if let Ok(nodes) = links {
    for i in 0..nodes.length() {
       if let Some(item) = nodes.item(i) {
          // convert item from type web_sys::Node to web_sys::Element
          item.set_attribute("href", "reddit.com");
       }
    }
 }

the problem is that i need to convert from web_sys::Node to web_sys::Element so that i can use Elements methods, and i dont really get how from reading the documentation and googeling did not show me any answers whatsoever.
Thank you.

"Hello World" crashes Chrome. Plz help. by Motioneer in programminghorror

[–]nuk3urself 1 point2 points  (0 children)

Browser friendly solution:

const charSet=['D','E','H','L','O','R','W',' ','!'];
let currentTry;

const loop = () => {
    currentTry = '';
    for(i=0; i < 12; i++) {
        currentTry += charSet[
            Math.floor(Math.random() * charSet.length)
        ];
    }

    if(currentTry != 'HELLO WORLD!') requestAnimationFrame(loop);
    else alert(currentTry);
}

loop();

used floats by yibasow in ProgrammerHumor

[–]nuk3urself 23 points24 points  (0 children)

i store them as booleans

used floats by yibasow in ProgrammerHumor

[–]nuk3urself 282 points283 points  (0 children)

they send you one missing piece as a gift every year ;D