Guizmus's Recent Forum Activity

  • Both seem ... equal. I wouldn't go with any of those though.

    What I would do :

    <img src="http://i.imgur.com/ISp46A8.jpg" border="0" />

  • Only way I see how would be to host some kind of server on the PC, and dialog with it with the websocket plugin (https://www.scirra.com/manual/153/websocket). I don't have knowledge to help you further this way though.

  • The problem you have is the last event : "player isReloading". Let's see how the computer will work with your script :

    • Ctrl pressed, set isShooting = true.
    • isShooting=true ? then start fire, and set isReloading = true
    • isReloading = true ? then wait 1 second and setReloading to false.

    Last event will be checked every tick, and so, every tick for 1 second, you will start a waiting period of 1 second and then set Reloading to false. This will make the Reloading set to false all ticks for 1 second basicaly.

    What you need to do : add a condition "Once while true" on the last event.

  • Hey there.

    Your basic game workflow should work.

    I have a concern though. The third array is more like a database than a dynamic array. I would suggest using the CSV plugin to do that, so you could access the datas with something more clear to read (column names is realy nice when you have lots of data for each items, plus it's easier to check/complete/modify item stats through Excel).

    Now let's take a look through your actions :

    o Player kills monster > call function "handle loot", passing monster.UID as parameter, before destruction of the monster object

    o Computer does a random number roll. > handled by the function

    o If the number roll is a success, the monster spawns a random item > handled by the function. spawn an item on the monster coordinates.

    o When the player collides("picks up") the item, the items corresponding number is added to the Slot array.

    Player On collision with Item, call function "pick up item" passing item.UID as parameter.

    The pick up function would first look for the first empty slot, then if it found one store the item in it, destroy the item object from the game. You should have a function that would update the "slot" display on the screen to call here.

    Then, you'll need a new "item object" (let's call it item2), different from the first one as it will be in your inventory, and would have a drag-drop behavior.

    item2 on drop on equipSlot : if the equip slot isn't empty, handle the unequipment of the object first. Then, update the EquipSlot with the caracteristics of the new item. Last, remove item from inventory/destroy the item2 object.

    I tried to described a little more what would be the script-flow, hope it helps.

  • Well, you are not that far, don't be afraid.

    If both players are in a family and only one is on the layout when you play, then you just have to replace every use of the "Character 1" object by the family itself. You can do a right click->replace object for this.

    The "slow" part will be the behaviors you put on the character 1. For a complete "familization", you would need to have those behaviors on the family, not on player 1.

    If both players play the same, and only the animation set changes, this would be the solution.

    Another solution, dirty but working, is without families. Instead, you have a single sprite for both players, and rename all the animations with a prefix, like playerName. This would meant "Player1__Attack", "Player2__Attack", ...

  • Yes of course. I used array to carry multiple datas at once.

  • The the solution I described should work then.

    You should be able to update a variable in C2 from the webpage by looking into the runtime object, in a javascript debugger too though. C2 is running on the page, so you could change the variable there. But as this wouldn't trigger a function in C2, having an interface between the page and C2 is more versatile.

  • Can't provide a capx, it all depends on your API for the actual integration. Mostly, it would go something like this :

    capx organization

  • One simple thing you could do, if you don't want to write a plugin, would be to check every tick a variable in the page, or the result of a function in the page. You can call the ExecJS function inside a "System:Compare two values" for example.

    More detail example :

    I have in my page a function "A" that collects informations to be send to C2. Each time I have to send informations to C2, I call this function, it stores datas.

    I have another function "B" that displays this information in a string encoded how it fits me. When this function is called, the stack of informations to be send to C2 will be emptied.

    Now in C2, in an EveryTick event, I would start by setting a local variable to the result of the call to the function "B" via an ExecJS. Then, I would read this variable. Explode, JSON decode->put it in an array, whatever fits, and do a for each to treat every action.

  • I'm not exactly sure how you want your movement to be. I took a look in your capx and here are some remarks :

    • instead of positioning your upper part over the lower every tick, use the Pin behavior.
    • if I understand space type movement, you should do multiple bullets behavior. The first will be the "booster". The others will be the straffs. Pushing left and right would increase/decrease the power of the straffs, making it strife left and right. Pushing up would increase the speed.

    Here is a capx doing this. The angle jump isn't here anymore.

    capx

    EDIT : i added more details in the code. To be clear, the problem you had was that rotating the lower part 90? when the left / right was pushed made the ship do a clean 90? angle in space, strange. Straff is here to help simulate that. I think the better way though would be to go with the physic behavior, and apply forces on acceleration/deceleration and side pushes.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Just download the last beta from the bottom bar of the website, and then execute it. It will remove the old version, upgrading it directly.

  • I downloaded and tried your example. Not seeing the problem, I watch some levels of princess peach to understand, and played around it a little.

    What I tried is removing the "is jumping" condition, and use smaller margins top and bottom (in the events 8 and 9) to move the camera at the last possible time, to prevent too much scrolling.

    It's hard to tell what they put on top of that in the game though, some small layouts don't scroll at all, but most I've seen seems to be linear, quite horizontal.

    Only small problem I saw was sometime the camera moving then stopping, then moving again... with no deceleration. This can be solved with some lerping in the scroll actions (tutorial)

Guizmus's avatar

Guizmus

Member since 26 Mar, 2013

None one is following Guizmus yet!

Trophy Case

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

Progress

15/44
How to earn trophies