sanitar's Forum Posts

  • a month ago, when saving a project to a local disk, I was given an archive file in c3p format, but now it offers to save in zip format.

    this is not convenient, because I save the html version at that time, and I have to manually rename the c3p project archive every time.

    Is it something wrong with me, or do I need to write to the github in the bugtrack?

    Tagged:

  • i have a fiew shirts of card in one sprite,each as frame.

    an animation speed for this sprite set 0,so i can place some exemplars of sprite on layer in editor,and set the frame-and i will have different shirts,it's ok.

    but when i place sprite on script,and try set a frame-it' no luck,just see the first frame.

     for (var a=1;a<=cards_for_each;a++)
     {
     runtime.objects["Card_shirt"].createInstance("Layer 10",opp_one_start_pos_x+(a*15),opp_one_start_pos_y);
     }
     runtime.objects["Card_shirt"].getAllInstances().animationFrame=1;
    

    despite on different indexes-i see an 0 frame.i was think that i must start animation for change frame on layer,so add below this row

    runtime.objects["Card_shirt"].getAllInstances().startAnimation("current-frame");

    and get error

    runtime.objects.Card_shirt.getAllInstances(...).startAnimation is not a function

    where is the mistake?

  • i have something wrong with sprite object,but don't understand what same.

    here is the code

    runtime.addEventListener("pointerup", e => OnMouseDown(e, runtime));
    function OnMouseDown(e, runtime){
    	SpritesClicked(e, runtime);
    }
    function SpritesClicked(e, runtime){
    	const sprites = runtime.objects.Cards_family.getAllInstances();
    	
    
    	for(var i = 0; i < sprites.length; i++) {
    		if(sprites[i].containsPoint(e.clientX, e.clientY)){
    		
    		 if (sprites[i].instVars.pushed==0)
    			 {
    			 sprites[i].instVars.pushed=1;
    				sprites[i].y=sprites[i].y-10;
    			 }
    		 else
    			 {
    			 sprites[i].instVars.pushed=0;
    				sprites[i].y=sprites[i].y+10;
    			 }
    		}
    	}
    }

    if the browser have free space beyound workspace-i just cant find where is area of containsPoint of object.if no free space(image#2)-i can found an active space,but it's too tight,and it's at the bottom of object when "pushed"=0,and jump to the top of object when "pushed"=1.what the hell?

    dropmefiles.com/8Clqf

  • I find that Construct usually dislikes and/or behave strangely when using objects that have 0 instance at edit time.

    true story

    and how to use that's objects?some like runtime copy to layout?

  • so,i found something

    if i write

    runtime.objects["Card_15"].createInstance("Layer 0","100","100");
    const aaa = runtime.objects["Card_15"].getAllInstances(); 
    console.log(aaa);

    i got this result

    but if i leave just

    runtime.objects["Card_15"].createInstance("Layer 0","100","100");
    

    and put this on button on click event-i got this one

    const aaa = runtime.objects["Card_15"].getAllInstances(); 
    console.log(aaa);

    and after this i can get variables.so i conclude that the object does not have time to be created before accessing the variables.i don't know how to fix it,for now i just place all sprites on unviewed place of layout at editor.i don't like this solution,but atleast it's work.

  • it's still actual for me

  • here is the cut of project,with the problem.if i leave this two row here

    runtime.objects["Card_15"].getFirstInstance().instVars["pushed"]=true;
    runtime.objects["Card_15"].getFirstInstance().instVars["suit"]=1;

    the card doesn't move on click.if i cut off it-card move as should be.so the bug in that two rows,but what exactly?

    dropmefiles.com/aauAh

  • up time

  • i make sprite in project,but not place it on layer at editor.add to this sprite two instance variables.

    till it not placed on layer-i can't edit variables.

    place sprite on layout runtime

    runtime.objects["Card_15"].createInstance("Layer 0","100","100");
    

    after that i try edit variables like this

    runtime.objects["Card_15"].getFirstInstance().instVars["pushed"]=false;
    runtime.objects["Card_15"].getFirstInstance().instVars["suit"]=1;
    

    but as i see in debug mode it take no luck.what i doing wrong?

  • well,i done it

    runtime.objects["Card_"+my_card[0]+my_card[1]].createInstance("Layer 0","100","100");
  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • half-found:

    runtime.objects.Card_&my_card[0]&my_card[1].createInstance("Layer 0","100","100");
    

    but how instead

    Card_&my_card[0]&my_card[1]

    make name from string "Card_" and two variables my_card[0] and my_card[1]?

  • i have a list of sprites,named "Card_**",where first * are trump,and second are index number of card.i get both numbers from server,and after that i must place all needed sprites on layer.how can i do it in runtime?

    Tagged:

  • found the solution

    request from android means like request from https site.if your server use http protocol-that is the problem.just use https,and don't forget change http to https in ajax request.

  • so what is the solution?