Author

Topic: Please help Call my contract - the basics (Read 141 times)

newbie
Activity: 1
Merit: 0
February 24, 2018, 04:50:07 PM
#1
 Huh
Hi, I have a question about the plugin that I hope someone can help me with.
I am trying to make a very simple game that calls data from a smart contract.

On Construct 2, I have installed both the 'ethereum' and 'ethereum contract' plugins. When I have a collision take place between two sprites, I want it to call the contract to get a stored data. Very basic stuff I think really - for example.. here is my starter contract code..


pragma solidity ^0.4.20;

contract SimpleStorage {
    uint storedData;

    function set(uint x) public {
        storedData = x;
    }

    function get() public constant returns (uint) {
        return storedData;
        
    }
}


-Now, for what I will be doing I won't need to set the storedData to change it because I want it to remain the same, and, frankly I'm still learning how to make a database contract that is unchangeable but one that I can still call and get the response with the data.

When I have sprite | on collision with sprite2 |.....

https://image.ibb.co/jAbPQx/js_error.png

If anyone can please, please help! I have had so much trouble trying all types of configurations. My only thought is that the call function is broken in the plugin's code, but I'm not sure.

Here is a screenshot of my C2 events for reference. Thank you in advance!
https://ibb.co/m3p0yH
Jump to: