I see a couple problems here.
There's no IV
That means that if you encrypt two identical messages with the same key, the cyphertext is the same. If even part of the message is the same, it's possible to determine the content of the other messages, and even the key. Read about crib-dragging and you will see why.
As strong as SHA-256
Not really. It's as strong as the key. You are using a numeric key, but how long? It's 4 bytes long, 16 bytes long, 512 bytes long? That makes all the difference.
Numeric key and SHA-256
A numeric, auto-incrementing key is bad. SHA-256 bruteforcing rigs are plentiful, usually they are sold as Bitcoin Miners. They are cheap, they are efficient, and very, very powerful. Use one to generate Terahashes per second, apply your very, very fast XOR calculation, calculate the entropy of the message, and an attacker can bruteforce your secret message in minutes, maybe less.
XOR encryption with truly random numbers
They are not random, they are deterministic. Bruteforce the first block, and all your data is broken. If the first bytes of the message are deterministic (like a request header, or file type header, or Greetings dear user kind of message), and attacker can use the crib-dragging attack to infer part of the hash and feed it to the bruteforcer.
Vulnerable to Know Plaintext Attack
If any attacker knows the plaintext-cyphertext pair, he knows the XOR-key, because
plaintext XOR cyphertext = KEY. That information goes to the bruteforcer and you know what happens.
Vulnerable to frequency analysis
256 bytes of data is enough to reconstruct part of the message using frequency analysis. Reconstructing the rest of the first 256 bytes is trivial, and results on a pair plaintext-cyphertext. This enables the know plaintext attack on the first 256 bytes, allowing the XOR-key to be discovered and bruteforced.
I know you are trying to learn, but trying to learn crypto by doing it is like making a gun by trial and error. You will shot yourself in the foot, or head. Wikipedia have a nice article on symmetric encryption, with a list of algorithms, the principles behind them, and the shortcomings.