mindfaQ's Recent Forum Activity

  • Placing them in the app directory by hand and using the appfolder expression of nwjs in combination with the subdirectory path should be able to lead you to different subdirectories in your app path.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Hmm, try:

    1) Run terminal in the linux game directory

    2) chmod a+x nw

    3) run the file, either through your file manager or terminal ("nw" without the quotes)

  • I think you would use your prefered xml editor on the sidelines and after you are done editing, copy it over again into the Construct 2 field.

    (I wouldn't do it either, but wouldn't have a big problem with it ^^)

  • Setting XML directly as a string into loading function would be a horror to edit it later

    Just curious: why? (I'm not saying it is easier maintainable than the variables spelled out in the engine, just don't see a big hurdle)

  • If you don't want to use a project file, but still read from a xml file, you could paste in the contents of your xml file into the xml load action.

    I'm not sure how much minifying does to that string. Perhaps you will still end up with a "hackable" solution, just less obvious. Though imo my philosophy would be "let people hack the game, if it is fun for them", as long as it is single player.

    If you don't want to use project files or pasting file contents in somewhere, I think it only leaves the solutions of setting the values in events / variables.

  • Hello,

    Would it be better to set up the card deck as a sprite with its cards imported as Animation Frames, instead?

    It does not really matter. If you want to animate your cards at some point, the solution with different animations is better. If you don't need animations, then using frames might be a tad easier.

    The while loop and there especially how the i is set up and how it uses global variables make me cringe a bit. So I use code with a for loop instead that's less error prone and imo easier to grasp, because everything is at one place in my example (also it is a function as it should be, since you want the shuffling to be reusable):

    https://copy.com/QXGb4317KtymzkQ9

    What should interest you the most is probably the event that creates the cards and sets the animations.

    For example you could write (with your names mentioned up top):

    "ID_H"&zeropad(deck.curvalue, 2)&"_CardName"

    Problem: if you want to fill in the CardName with an actual card name, this won't work anymore.

    In that case you will need a dictionary or another array, where you store the name, which then you can let C2 read, when it's time to set the animation.

    I'm not sure what kind of properties your cards will end up with. There is also the possibility to just fill an array with all the information, each card has its own x, and then y = 0 would be card name, y = 1 would be animation name and so on. You can read in stuff like this even from a csv file. Just be aware that importing the data from csv will import numbers as string, if you don't explicitly convert them upon adding them to the array.

  • Your php is set up to return the data it received?

  • Well, it's easy to put the names into an array and then you could easily get the name of the terrain with an expression like:

    array.At(tilemap.TileAt(tilemap.PositionToTileX(mouse.X), tilemap.PositionToTileY(mouse.Y)))

    That doesn't change the fact that now your gameplay system still does not know the specifics of each terrain field, so you still need to save that data somewhere, either hard code it into the events or (better) put the data into an array... perhaps in the array you now are already using.

    So if you only have the speed and defense modifiers, you could easily store the name of the terrain at y-index 0, the speedmodifier at y-index 1, the defense modifier at y-index 2.

    and let's say you wanna use your event exampel, then you could write it like:

    Compare Tile At (X,Y):

    * terrain_type = array.at(tile_ID, 0)

    * terrain_speed = array.at(tile_ID, 1)

    * terrain_defense = array.at(tile_ID, 2)

    If you don't know how to use array... there is plenty of topics, tutorials and the manual, where you can learn how to use them.

  • I dont see why you would need 10 events to detect tiles on 1 tile map.

  • so leave the box unchecked...

  • I'm not used to working with the platforming behaviour, but wouldn't something like this work:

    (if only moving along x)

    player is on platform: set player.x to player.x + platform.speed * dt

    This should overlap your other movement. It you want the player to carry over momentum from jumping off the platform, you'd need to add some code for it, too.

  • No problem with starting medium, if you have prior programming knowledge, imo.

    The only problem I see is that you can't plan well up front, so you might run yourself into a dead end or unorganized project because of bad planning.

mindfaQ's avatar

mindfaQ

Member since 12 Oct, 2013

None one is following mindfaQ yet!

Trophy Case

  • 11-Year Club
  • Coach One of your tutorials has over 1,000 readers
  • Email Verified

Progress

13/44
How to earn trophies