gumshoe2029's Recent Forum Activity

  • Yes, this is possible.

    How much accuracy do you need in your timestamp?

    If you just want to use local time, Rex Date plugin will give you timestamps from the system clock that the JavaScript is running on presently. If you need to access a more accurate time source (like a timing server), you can do an AJAX call and parse the time using a modified version of the Rex Date plugin that I can send you.

    Rex Date: http://c2rexplugins.weebly.com/rex_date.html

    Then you could just store the timestamp, mouse.X, mouse.Y in Arrays, Hashmaps, etc. every tick (per ~1/60 sec), or once per second.

  • You should use sprite instance ids (or you could probably use UIDs) and when a player clicks on a sprite, place the id (or UID) into a global variable (named 'lastClicked' for this post) then just do a destroy action for the sprite where id=lastClicked.

  • I have not fiddled with it before, so I am not sure.

  • We are using "Scale outer" for "Fullscreen in browser" mode, which makes enormous differences in where the "edges" of the screen are relative to the internal coordinate system in Construct.

    I have found this to work fairly reliably across different modes:

    CanvasToLayerY("backdrop",0,0)  // top of screen
    CanvasToLayerY("backdrop", WindowWidth, WindowHeight)  // bottom of screen
    CanvasToLayerX("backdrop",WindowWidth, WindowHeight)  // right side of screen
    CanvasToLayerX("backdrop",0,0)  // left side of screen
    [/code:1x97qc0t]
    I use these to make my user interfaces in Construct fully dynamic (i.e. if the user resizes the window, Construct will automatically resize everything inside).
    
    Note: "backdrop" is my primary display layer's name.
  • You could just have the app list displayed as a JSON string then import it into your Construct app?

  • What plugin? Your question is kind of vague.

  • You have to include all three dimensions when working with C2-array JSON strings. You were missing the last dimension in your original string. It was included in korbaach 's string.

  • And it doesn't have a byte parser built in? Perhaps you could modify that plugin and add that functionality to it.

    I have modified a few of Rex's plugins. It is FAR easier to modify plugins than to write new ones.

  • I could, but it would be a lot of work. I haven't become really competent with the IDE myself. I mostly work on the server side in Java.

    How did you come about receiving a byte array to begin with?

  • I had to write a Java object to convert from Java arrays into Construct-friendly JSON.

    This is my half-way solution (it only converts to a one-dimensional Width-based C2 array):

    public class C2 {
    	//-------------------------------------------------------------------------------------------------------------------
    	// Method to output Construct-compatible JSON Array structures
    	//-------------------------------------------------------------------------------------------------------------------
    	public static String outputToC2Array(ArrayList<String> list){
    		
    		StringBuilder sb = new StringBuilder("");
    		try{
    			if(list!=null && list.size()>0){
    				sb.append("{\\\"c2array\\\":true,\\\"size\\\":[" + list.size() + ",1,1],\\\"data\\\":[");
    				
    				for(int i=0 ; i < list.size() ; i++){
    					sb.append("[[" + list.get(i) + "]]");
    					if(i < list.size() - 1) sb.append(","); //skips the last comma
    				}				
    				sb.append("]}");
    			}
    			return sb.toString().replaceAll("\\\\\"", "\"");
    		} finally {
    			sb = null;
    		}
    	}
    	//-------------------------------------------------------------------------------------------------------------------
    	// Method to reconstruct arrays from Construct-compatible JSON strings
    	//-------------------------------------------------------------------------------------------------------------------
    	public static ArrayList<String> arrayFromC2jsonString(String c2json){
    		ArrayList<String> returnList = new ArrayList<String>();
    		try{
    			if(c2json.contains("data\":")){
    				String subS = c2json.substring(c2json.indexOf("data\":", 0)+9, c2json.length()-4);
    				String[] pieces = subS.split("\\]\\],\[\[");
    				for(String piece : pieces){
    					returnList.add(piece);
    				}
    			}
    			return returnList;
    		}finally{
    			returnList = null;
    		}
    	}
    }
    [/code:cwm5su9d]
    
    Basically, I just parse the array into a C2-friendly JSON string.
  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • It was at the top?! I never look at dates. :-p

gumshoe2029's avatar

gumshoe2029

Member since 4 Mar, 2014

None one is following gumshoe2029 yet!

Trophy Case

  • 10-Year Club
  • Email Verified

Progress

11/44
How to earn trophies