maanantai 25. heinäkuuta 2016

Background image and camera following player



So today I added a background image and made the camera following the character. Each client now gets the info about which character it is controlling, that was not needed before. Also modified sprite drawing so that the sprite textures can have different sizes. Thinking about using Kenney assets to make the game look better, first I would have to add loader for sprite-sheet XML descriptions. Probably it would be helpful to add materials to a database.
I'll be travelling for next two weeks, there will probably be no progress during that.

perjantai 22. heinäkuuta 2016

Today's progress

Made the socket.io server secure, it was very easy, just had to use https instead of http. Worked on Ethereum stuff, added support for delegated messages in the game server. This way the player does not have to interact with Ethereum directly. Here is a snippet showing how it is supposed to work:

    function delegateConnect(address snd, address addr,
                             uint8 v, bytes32 r, bytes32 s) {
        bytes32 hash = sha3("connect", snd, addr, nonce[snd]);
        if (!connection[sha3(snd,ecrecover(hash, v, r, s))]) return;
        nonce[snd]++;
        delegations[snd]--;
        connection[sha3(snd,addr)] = true;
    }

Next week I'll make the camera follow the character in the game, and support for background images in levels.

torstai 21. heinäkuuta 2016

Some progress on Ethereum backend

I managed to make a page where it is possible buy shares and connect accounts. I used eth-lightwallet, ethereumjs-accounts doesn't seem to work anymore. I'm thinking about switching to use simply web sockets instead of socket.io.

Also worked on uploading contracts into testnet, best way seems to compile using solc npm package. Then I upload the contract and store the results to database.

keskiviikko 20. heinäkuuta 2016

Fireballs


Modified the fireball so that it now destroys enemies. Also made fireball power-up item that is needed to shoot the fireballs.

On the back-end side, I'm working on Ethereum integration. The idea is that anyone can run a server, but there is still a single identity for players. There are also rewards for best levels. Started writing a contract, and got a node running in the Ethereum testnet.

tiistai 19. heinäkuuta 2016

Linking accounts

I didn't have much time today, but still implemented linking accounts. Linking accounts is useful so that the secret key doesn't have to be copied around. I think I'll implement better fireballs tomorrow, and hopefully some other stuff.

maanantai 18. heinäkuuta 2016

User Login

Today just added simple user login. Authentication is implemented using elliptic.js. It is not really very secure, because the web page is in full control of the key, perhaps there is a plugin or something that could help. Next I'll have to add a way to link several keys with an account. Should not be too complicated, but I'll be otherwise busy tomorrow.

perjantai 15. heinäkuuta 2016

Hazards


Today I made the monster more dangerous and added fire. When the player dies, it just respawns in the same level. Also added some sound effects. Just used Bfxr to make the effects. Monday I'll work on user management and registration.