Minimaps?

This forum is currently in read-only mode.
From the Asset Store
The BEST and most functional minimap you'll ever find - along with an extremely satisfying & polished tank arena fighter
  • How would one go about creating a minimap/radar that sticks at the corner of the screen and only displays some objects on it?

  • Since I collect all usefull .cap files the users post on the forum, I also have a minimap example. I didn't made it. Here's the link ->

    http://dl.dropbox.com/u/26932498/minimap.cap

    edit: unbelievable! found the old thread xD Credits goes to Mipey!

    http://69.24.73.172/scirra/forum/viewtopic.php?f=8&t=5867

  • Also, do you have any links to a tutorial that explains how arrays work? I'm confused by them.

  • Tulamide explained once in a very good way the basics of an array:

    > ...what does it buy me over just using a 3D array such that one index is the Object.UID, the second dimension is the variable name, and the third is the value?

    That's not the way, arrays work. An array is just a line of cells, and you access those cells by using coordinates. Whatever count of coordinates you have, it leads to exactly one cell.

    <img src="http://www.kevblog.co.uk/blog/97/as3_2D_3D_arrays.gif" border="0">

    <img src="http://www.codeproject.com/KB/cs/Arrays-dontumindit/array9.gif" border="0">

    So, to access the data you need to do something like this: var = array(2, 1, 4)

    To store a value it is: array(2, 1, 4) = "one cell"

    ....

    If you want to read the whole thing(but the rest isn't about the array itself):

    http://www.scirra.com/forum/container-type-functionality-for-families_topic46974.html

  • I also made a more complete tutorial about arrays and hash tables a year ago. It includes demo caps besides the written explanations.

    http://www.scirra.com/forum/tutorial-variables-arrays-hash-tables-an-overview_topic41773.html

  • <offtopic> What would we do without Tulamide? <img src="smileys/smiley36.gif" border="0" align="middle" /> </offtopic>

    You allways have interessting stuff off pat^^

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • :D Thanks a bunch zyblade and Tulamide!

    Also Tulamide, so your example cap for the array is basically writing data to the array that stores the animation frame its on? And how would I go about creating an inventory using an arrya, would I write a variable to an X,Y position on the array? Or would using 'S' be more useful for this?

  • :D Thanks a bunch zyblade and Tulamide!

    Also Tulamide, so your example cap for the array is basically writing data to the array that stores the animation frame its on? And how would I go about creating an inventory using an arrya, would I write a variable to an X,Y position on the array? Or would using 'S' be more useful for this?

    It depends on how your inventory is organized and what information has to be saved. Use an array whenever you can map a situation in your game directly to a bunch of cells. For example, if your inventory is a bar with a fixed number of slots, it is very easy to map slot a to cell 1, slot b to cell 2, etc.

    If your inventory is more like in an rpg, a bag that can store a non-fixed number of objects, then a hash table would be more suitable. You could create a key with the name of the object and a value representing the id or position in the bag's list.

    You can always store more than one information at once. Just use strings instead of numbers. In an array, you could fill a cell with the string "Green Pill, 25, 12.52, C" and later extract the informations using the expression 'get token'.

    But if it is a really huge number of informations that needs to be stored per inventory slot, you might indeed consider using 's'. With its ways to create data structures and reference them in other superstructures, it is way ahead of any other method in Construct, as soon as something is object oriented.

  • I guess I'll go with the array then, however when storing values in the array can you use strings? Or do you have to use integers. Also how do you access the array using construct's expressions.

    Having a problem now, I added a condition to shooting to check if the index 1 is equal to 1, then allow the player to shoot. I also set up an event so that when the player collides with the rifle pickup it sets the index 1 to 1. Yet the player still cannot shoot.

    By the way I know that using global variables for this would work and be much easier, but I want to learn arrays.

    Also, how would I add vehicles that the player can enter and leave?

  • I guess I'll go with the array then, however when storing values in the array can you use strings? Or do you have to use integers. Also how do you access the array using construct's expressions.

    This cap will answer the questions: access_string_array.cap

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)