Bitcoin Forum
June 28, 2024, 05:13:32 PM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
  Home Help Search Login Register More  
  Show Posts
Pages: [1]
1  Bitcoin / Project Development / Please help Call my contract - the basics on: February 24, 2018, 09:50:07 PM
 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 |.....



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
Pages: [1]
Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!