fabien's Forum Posts

  • 8 posts
  • Hi

    I have 16 sprites of type 'square'

    I have created an instance variable for this type, named 'monster'

    I would like to initialize each square.monster with a different value

    I try to do a loop but I can't get the action to write my expression :

    square(loopindex).monster=random(2,9)

    how can I do ?

    thx

    Fabien

  • Hi

    I have several variables (username,game_id,...) in my PHP script

    I would like to send an Ajax request with those variables in construct:

    mysite.fr/ajax.php

    How can I pass my variables from my PHP to the js file ?

    I tried to generate my variables like that :

    <script>

        <?php echo 'username="'.$user->id.'";';?>

    </script>

    <script src="c2runtime.js"></script>            

    but it doesn't work ..

    any idea ?

    Fabien

  • Ok I found it, when I export my game, I can fill an images path, and write a strange name like cocorico

    I just have to edit the js file after and replace cocorico with my real path

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Hi,

    Nicely done

    I have added one more variable to move the ball only when I drag it and it works perfectly.

    thank you for your help

    (sorry but I am a little bit in a hurry, I am a trainee and I have to decide as quick as I can the technology I will use for my project ;) )

    Fabien

  • Nobody knows ?

    I tried to put :

    1)

    The wall : solid

    The ball :solid + drag

    => drag ok but no collisions with the wall

    2)

    The wall ball

    The player ball + drag + 8 movements

    => drag ok, collisions with the wall ok but if I drag over the wall to the opposite side, the ball will jump over the wall

    How can I constraint it into the street of my labyrinth ?

  • Hi,

    I will try to be clear :|

    There are 2 ways to embed our games in an html page :

    1) with an iframe, it works

    2) to copy the code in our own page, but that's where I have an issue :

    the path used in the javascript code is ./images/.... to access the images files

    I am using a PHP framework and this path doesn't work, I need something like that public/assets/img/... to access my files

    so how can I do to change this path ?

    thx

  • What are the behaviors to drag a ball in a labyrinth, without the ball jumping over the walls when we drag over it ?

    thx

  • I have a javascript error because it can't find my images folder( I don't use the iframe solution)

    How can I do to specify my own image path ?

    thx

  • 8 posts