brunopalermo's Recent Forum Activity

  • What is the behavior you're trying to achieve here, exactly?

  • I usually prefer using a timer for the gun/player object. It's better to config and evolve (if want to evolve the weapon and make the burst longer or faster).

    Here's an example I made using the Ghost Shooter template.

    https://www.dropbox.com/s/xulbpzmkkgc0r ... .capx?dl=1

    Use asdw or the arrows to move, mouse to aim, shoot with left click and burst with right click.

    Hope this helps. Cheers!

  • Hey Christmas,

    You'll probably use the Browser>Execute Javascript action, as you guessed. The thing is, if you don't know Javascript, someone will have to write some code for you. Anyway, talk to your employer. Chances are they already have javascript functions to deal with those actions, so, you'd just have to call those functions using the Browser>Execute Javascript action.

    hope this helps. Cheers!

  • Thanks for replying Bruno

    Based on your answer, this is what I've managed so far:

    I have a couple of questions.

    • Create productBox at columnX, loopindex * (productBox.Height + boxSpacer) - I'm guessing productBox is am image, is this correct? Also, how do I add the actions at columnX, loopindex * (productBox.Height + boxSpacer)
    • Load imagePlaceholder from array.At(4) - Do I just add the object name of each image in column 4 of the Array?
    • Spawn XXX at imagepoint(XXX) - how do I use Spawn? It's not available as an action.
    • What is an imagepoint and how do I create one?

    Thanks for your help on this.

    First of all, your Repeat loop should be nested inside the Ajax>On completed event. Now to your doubts:

    1. Yeah, it's a bogus name for a Sprite object that would be the base of your list item. When you create an object it will ask you for the X, the Y and the layer at which it will be created. In my example, I calculate the Y based on the height of the box and the spacing between boxes.

    2. In my example I'm loading an external image, so in that case you would add the relative or absolute url of the image. Adding all images as individual sprites is very cumbersome and I'd strongly recommend you don't do that. You may use the approach I mentioned and create one sprite and storing product images as its frames. In that case, the image column would just tell the frame to go to. Also, notice that array indexes start at 0, so 4 is, actually, the fifth column.

    3. "Spawn another object" is an object action, that is, you'll got to "productBox>Spawn another object" (or whatever name you use for your product box).

    4. Spawn requires the new object to be created at an imagePoint. Imagepoints are like "hotspots" you can add to a Sprite object. All Sprite objects have one imagepoint (index 0) by default, which is their origin. You can add more imagepoints by opening the Sprite in edit mode and picking the tool that looks like an aim or crosshairs. When you pick the tool a window will show a list of all imagepoints for that image. You can add new ones using that window.

    Hope this helps. Cheers!

  • Your guess there is right. Just use AJAX, load the array from LastData and run a loop.

    Something like:

    System | Repeat array.Width times |  Create productBox at columnX, loopindex * (productBox.Height + boxSpacer)
                                      | Load imagePlaceholder from array.At(4)
                                      | Set productName.Text to array.At(1)
                                      | Set cost.Text to array.At(0)
                                      | Set shortDesc.Text to array.At(2)
    
    productBox | On Created | Spawn productName at imagepoint(0)
                            | Spawn cost at imagepoint(1)
                            | Spawn shortDesc at imagepoint(2)
                            | Spawn imagePlaceholder at imagepoint(3)
                            | Spawn selectButton at imagepoint(4)
    [/code:1gkhwgxy]
    
    Note you must create all those imagepoints in the productBox sprite and position the at the positions the other graphic elements should be spawned. You could use the container approach, but I prefer spawning stuff at the positions rather than creating everything and then positioning everything relative to the productBox.
    
    Also, if you have few products and will never add more, you may have all images as frames of one sprite and just set the frame accordingly. But it would be a terrible idea if this product list must be scalable.
  • Have you tried Bullet behavior?

    Here's a demo made with Bullet behavior: http://constructgamelab.000webhostapp.com/boomerang

    Is that what you're looking for?

    Cheers.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • I can't even understand the problem by the two images. You should detail it more if you have ay hope of getting any help.

    Cheers.

  • If I get it right, you want to use an event sheet from the asset pack in your own project, right? If that's the case, just create an empty event sheet on your project, select all events from the other event sheet, copy and paste into your empty sheet.

    You will need to have all variables and objects, with the same names, in your project, though, or it won't paste.

    Hope this helps. Cheers!

  • So, it's basicaly the same thing we said before. You use an index and delete it, right?

  • , how does that avoid repetition?

  • And here's a capx...

    https://www.dropbox.com/s/m4lscjllmh33h ... .capx?dl=1

    Cheers.

brunopalermo's avatar

brunopalermo

Member since 7 Jun, 2013

Twitter
brunopalermo has 6 followers

Connect with brunopalermo

Trophy Case

  • 11-Year Club
  • Coach One of your tutorials has over 1,000 readers
  • RTFM Read the fabulous manual
  • Email Verified

Progress

14/44
How to earn trophies