mrtumbles's Forum Posts

  • I think the simplest way to do this might be to have the camera track an object the size of the screen. Have this object always pathing towards the player. When it overlaps areas that shouldn't be seen by the camera, steer it away from those objects. Good luck!

  • To do this you'll want loops, an an array will make it easy too. Add an array to your project with a Width of 5, a Height of 5, and a Depth of 1. The array can be seen as a 'spreadsheet' where you store the result of each turn. When a player places a piece, fill the appropriate cell in the array with the appropriate value. For example:

    The YELLOW player's turn, they have placed a piece at X:
    .....
    .YYX.
    ..B..
    ..B..
    .....
    
    Array > Set at x,y > X: 3, Y: 1, Value: "yellow" [/code:2s1fo3nl]
    
    Running this at the end of each turn will make it much easier to check for a win-state - which is what we check for next. There are a lot of ways to do this, but here's what I can think of:
    
    [code:2s1fo3nl]
    Array > For each element (xy)
    System > Compare two values > 
    First Value: Array.At( Array.CurX - 1 , Array.CurY )&Array.At( Array.CurX  , Array.CurY )&Array.At( Array.CurX + 1 , Array.CurY ) = "yellowyellowyellow" | Array.At( Array.CurX , Array.CurY + 1 )&Array.At( Array.CurX  , Array.CurY )&Array.At( Array.CurX , Array.CurY - 1 ) = "yellowyellowyellow" | Array.At( Array.CurX - 1 , Array.CurY )&Array.At( Array.CurX  , Array.CurY )&Array.At( Array.CurX + 1 , Array.CurY ) = "blueblueblue" | Array.At( Array.CurX , Array.CurY + 1 )&Array.At( Array.CurX  , Array.CurY )&Array.At( Array.CurX , Array.CurY - 1 ) = "blueblueblue"
    Second Value: 1
    [/code:2s1fo3nl]
    
    This seems pretty long-winded but it's actually a single event, which is nice. The 'For each element (xy)' action means the event will be run for every cell in the Array's x,y dimension. The first of the two values to compare is a long 'or' expression - each vertical line '|' character can be read as 'or'. The conditions in the expression create strings that represent the orthogonal lines through the current cell, and compare them to strings that define a win-state, eg: "blueblueblue" or "yellowyellowyellow". Because they are part of an 'or' expression, if any of the conditions in this expression are met, the output of the expression will be "1" - so the second value with which to compare the first should just be "1".
    
    Place whatever actions go in your win condition into this action - good luck! What a fun little problem.
  • The 'faster than its supposed to' thing is because of the density - which is judged by the area of the collision polygon. By reducing the area of the polygon from the bounding box, you decrease the perceived 'mass' of the object.

    Unfortunately, I can't explain why you're getting asymmetrical movement problems - it's not something I've come across myself

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • In the most basic terms:

    Ball.Y > BarLEFT.Y

    ? Add ( dt * x ) to BarLEFT.Y

    : Subtract ( dt * x ) from BarLEFT.Y

  • Post a CapX, this will make it much easier for people to diagnose and solve your problem.

  • And since your English is bad I'd recommend a 'thank you' is customary when someone volunteers help

  • Oh, I did forget a step: after you've set the position of the Cursor, set the Mouse.PrevX/Y to Mouse.X/Y

  • Try teleporting the cursor.

    Don't post again without a CapX.

  • https://chilly-durango.itch.io/level-ge ... ucing-evie

    It doesn't explain why - but I guess why not? <img src="{SMILIES_PATH}/icon_razz.gif" alt=":P" title="Razz"> Her name is Evie - she can write music, poems, novels, dialog, make up location or character names - you name it.

    But she's also such a fat cow she won't fit through the usual download channels...

  • You can simulate this by simulating a cursor, the result therefore only working within the game and circumventing the above security issue.

    Add a Cursor sprite.

    Have variables which track the X and Y of the Mouse. Call them MousePrevX & MousePrevY.

    Every tick:

    -> Set Cursor X to Self.X + ( Mouse.X - MousePrevX )

    -> Set Cursor Y to Self.Y + ( Mouse.Y - MousePrevY )

    Don't forget to use the Cursor's position rather than the Mouse's when judging things like what's being clicked on etc. Good luck!

  • I'm working on a Markov chain generator that handles quite large amounts of data. Once the JSONs get larger than 1MB, I can't get them to download using the [Dictionary>Download] action. [Browser>String download] option produces the same result: 'Download failed: server error.'.

    Any suggestions?

  • All you need to do is have your code specify a specific instance. Usually the best option is using the 'Pick nearest' condition

  • You can make something a little like Trials Fusion, which has very similar controls and mechanics to ExciteBike. This is a fantastic tutorial I've followed in the past:

    https://www.scirra.com/tutorials/240/physical-bike

  • Toolkit: https://chilly-durango.itch.io/level-generator-toolkit

    Sample output: https://imgur.com/a/IRKBQ

    [quote:33fqt4q6]The Level Generator Toolkit comprises of a bucket of functions (currently 23, including a few diagnostic functions) which can be used to create all kinds of procedurally-generated environments. The Toolkit is designed to help developers understand the contextual potential of all sorts of different algorithms and processes.

    Any questions, I'd be happy to answer. I love discussing this project, and procgen in general <img src="{SMILIES_PATH}/icon_e_smile.gif" alt=":)" title="Smile">

  • These are referred to as 'prefabs'. They're used a lot in roguelikes, and the community over at reddit.com/r/roguelikedev recently had a Q&A on this very subject, it's well worth a read here ( https://www.reddit.com/r/roguelikedev/c ... p_prefabs/ )

    Your shopping list should be:

    1. A way of writing prefabs to storage

    It depends on how you want to build your world. If you can use tiles to build your world, brilliant - you can use a multi-line string to represent your prefabs. If not, you're in for a rockier ride which will likely involve writing a basic level-editor to save the correct metadata for you.

    2. Storage device for holding your prefabs in your project

    Again, assuming a tile-based world, I would use an array for this. Fill the array with a different prefab on each Z-index from (1).

    3. A way of stitching them together into rooms

    In its simplest form, this would probably look a lot like Primm's maze generating algorithm. ( https://en.wikipedia.org/wiki/Maze_generation_algorithm ) Essentially you start from a given point, and continue adding prefabs into vacant spaces in the world until it's large enough for you. As you go, connect each new prefab to an existing prefab placed before it. Et voila.

    I am aware this is a vast over-simplification, but a full explanation would be... lengthy. Good luck!