Search Results

Search found 853 results on 35 pages for 'tile'.

Page 17/35 | < Previous Page | 13 14 15 16 17 18 19 20 21 22 23 24  | Next Page >

  • How do I draw a scrolling background?

    - by droidmachine
    How can I draw background tile in my 2D side-scrolling game? Is that loop logical for OpenGL es? My tile 2400x480. Also I want to use parallax scrolling for my game. batcher.beginBatch(Assets.background); for(int i=0; i<100; i++) batcher.drawSprite(0+2400*i, 240, 2400, 480, Assets.backgroundRegion); batcher.endBatch(); UPDATE And thats my onDrawFrame.I'm sending deltaTime for fps control. public void onDrawFrame(GL10 gl) { GLGameState state = null; synchronized(stateChanged) { state = this.state; } if(state == GLGameState.Running) { float deltaTime = (System.nanoTime()-startTime) / 1000000000.0f; startTime = System.nanoTime(); screen.update(deltaTime); screen.present(deltaTime); } if(state == GLGameState.Paused) { screen.pause(); synchronized(stateChanged) { this.state = GLGameState.Idle; stateChanged.notifyAll(); } } if(state == GLGameState.Finished) { screen.pause(); screen.dispose(); synchronized(stateChanged) { this.state = GLGameState.Idle; stateChanged.notifyAll(); } } }

    Read the article

  • Sorting for 2D Drawing

    - by Nexian
    okie, looked through quite a few similar questions but still feel the need to ask mine specifically (I know, crazy). Anyhoo: I am drawing a game in 2D (isometric) My objects have their own arrays. (i.e. Tiles[], Objects[], Particles[], etc) I want to have a draw[] array to hold anything that will be drawn. Because it is 2D, I assume I must prioritise depth over any other sorting or things will look weird. My game is turn based so Tiles and Objects won't be changing position every frame. However, Particles probably will. So I am thinking I can populate the draw[] array (probably a vector?) with what is on-screen and have it add/remove object, tile & particle references when I pan the screen or when a tile or object is specifically moved. No idea how often I'm going to have to update for particles right now. I want to do this because my game may have many thousands of objects and I want to iterate through as few as possible when drawing. I plan to give each element a depth value to sort by. So, my questions: Does the above method sound like a good way to deal with the actual drawing? What is the most efficient way to sort a vector? Most of the time it wont require efficiency. But for panning the screen it will. And I imagine if I have many particles on screen moving across multiple tiles, it may happen quite often. For reference, my screen will be drawing about 2,800 objects at any one time. When panning, it will be adding/removing about ~200 elements every second, and each new element will need adding in the correct location based on depth.

    Read the article

  • BUILD 2013 Session&ndash;Alive With Activity

    - by Tim Murphy
    Originally posted on: http://geekswithblogs.net/tmurphy/archive/2013/06/27/build-2013-sessionndashalive-with-activity.aspx Live tiles are what really add a ton of value to both Windows 8 and Windows Phone.  As a developer it is important that you leverage this capability in order to make your apps more informative and give your users a reason to keep opening the app to find out details hinted at by tile updates. In this session Kraig Brockschmidt cover a wide array of dos and don’ts for implementing live tiles.  I was actually worried whether I would get much out of this session when Kraig started it off with the fact that his background is in HTML5 based apps which I have little interest in, but the subject almost didn’t come up during his talk.  It focused on things like making sure you have all the right size graphics and implementing all of the tile event handlers.  The session went on to discuss the message format for push notification and implementing lock screen notification and badges. As with the other day 1 sessions it was like drinking from a fire hose, but it was good stuff.  Check it out when they post it on Channel 9. del.icio.us Tags: BUILD 2013,Live Tiles,Windows 8.1

    Read the article

  • What are some ways to separate game logic from animations and the draw loop?

    - by TMV
    I have only previously made flash games, using MovieClips and such to separate out my animations from my game logic. Now I am getting into trying my hand at making a game for Android, but the game programming theory around separating these things still confuses me. I come from a background of developing non game web applications so I am versed in more MVC like patterns and am stuck in that mindset as I approach game programming. I want to do things like abstract my game by having, for example, a game board class that contains the data for a grid of tiles with instances of a tile class that each contain properties. I can give my draw loop access to this and have it draw the game board based on the properties of each tile on the game board, but I don't understand where exactly animation should go. As far as I can tell, animation sort of sits between the abstracted game logic (model) and the draw loop (view). With my MVC mindset, it's frustrating trying to decide where animation is actually supposed to go. It would have quite a bit of data associated with it like a model, but seemingly needs to be very closely coupled with the draw loop in order to have things like frame independent animation. How can I break out of this mindset and start thinking about patterns that make more sense for games?

    Read the article

  • Collision Detection Problems

    - by MrPlosion
    So I'm making a 2D tile based game but I can't quite get the collisions working properly. I've taken the code from the Platformer Sample and implemented it into my game as seen below. One problem I'm having is when I'm on the ground for some strange reason I can't move to the left. Now I'm pretty sure this problem is from the HandleCollisions() method because when I stop running it I can smoothly move around with no problems. Another problem I'm having is when I'm close to a tile the character jitters very strangely. I will try to post a video if necessary. Here is the HandleCollisions() method: Thanks. void HandleCollisions() { Rectangle bounds = BoundingRectangle; int topTile = (int)Math.Floor((float)bounds.Top / World.PixelTileSize); int bottomTile = (int)Math.Ceiling((float)bounds.Bottom / World.PixelTileSize) - 1; int leftTile = (int)Math.Floor((float)bounds.Left / World.PixelTileSize); int rightTile = (int)Math.Ceiling((float)bounds.Right / World.PixelTileSize) - 1; isOnGround = false; for(int x = leftTile; x <= rightTile; x++) { for(int y = topTile; y <= bottomTile; y++) { if(world.Map[y, x].Collidable == true) { Rectangle tileBounds = new Rectangle(x * World.PixelTileSize, y * World.PixelTileSize, World.PixelTileSize, World.PixelTileSize); Vector2 depth = RectangleExtensions.GetIntersectionDepth(bounds, tileBounds); if(depth != Vector2.Zero) { if(Math.Abs(depth.Y) < Math.Abs(depth.X)) { isOnGround = true; position = new Vector2(position.X, position.Y + depth.Y); } else { position = new Vector2(position.X + depth.X, position.Y); } bounds = BoundingRectangle; } } } }

    Read the article

  • Help with collision detection method [on hold]

    - by derek jones
    I was wondering if any of you could spare me some time to go over some collision detection on my platform engine. i tried XNA a few years back but for reasons i wont go into online could not continue, my health is now at a state where i am ready to try again but due to my current circumstances (and age) schooling is out of the question so i turn to you guys for help. Whilst i can adapt the MS sample ok and have some great features, you will agree modifying code is not really learning. So i have spent the last couple of week going over my old MS code and lots of stuff online and decided on what i want and have ported most of it over to code that i understand 90% of. I have my player class that moves about, jumps with gravity, has animations and a bounding box that follows it around. I have my map & basic level class to load levels from text files. Its just how i handle the collisions that i am struggling with as i will want per pixel collision on some tiles(i have code for this in a pong game i made so that should be ok). I'm pretty clear in my mind on what i need to do its just putting it in code and in the right place, here's what i was thinking. I was going to do it all in layers, have a tile layer, a collision layer & an item layer this way i could make a nice map editor in Win Forms at some point. Anyway i need to read in the collision layer the assign each tile a rectangle and collision property, and this is where i get me. Would any of you be able to spare some time and go over this with me ? I will post some code later Regards Del

    Read the article

  • What could cause a sudden stop in Box2D?

    - by alexanderpine
    I'm using Box2d for a game, and I have a bug that's driving me nuts. I've simplified the situation down to a square player sliding back and forth frictionlessly on top of a floor composed of a series of square tiles, driven by the left and right keys (which apply a horizontal force). Works great, sliding back and forth across the whole floor. Except... Every once in a while, the player will suddenly stick at the edge of one of the tiles as if it is hitting a (nonexistent) wall. Further pushes in the same direction it was traveling will fail, but as soon as I push backwards once in the opposite direction, I can push forwards past the sticking point again. The sticking point seems to be random, except for being on the edge of a tile. Happens while going left or right. For debugging purposes, I keep the Positions/velocity values for the previous two update ticks and print them out when this stop occurs. As an example, here you see the player moving right, decelerating slightly; pos2 should be about 8.7, but it stops dead instead. tick0: pos= 8.4636 vel= 7.1875 tick1: pos= 8.5816 vel= 7.0833 tick2: pos= 8.5816 vel= 0.0000 So, as the player is 0.8 and the tiles 1.0 wide, the player is stopping just as it is about to cross onto the next tile (8.5816 + 0.8/2 = 8.9816). In fact, I get a collision message (which I ignore except noting that it happened). It only seems to happen at x.5816 (or -x.4184) while moving right, and x.4167 (or -x.5833) while moving left I said that it's like hitting a wall, but in fact, when it hits a wall, the numbers look more like: tick0: pos0= 12.4131 vel2= 8.4375 tick1: pos1= 12.5555 vel1= 8.5417 tick2: pos2= 12.5850 vel0= 0.0000 so it moves further right on the last tick, which puts it in contact with the wall. Anyone seen anything like this. Any suggestion on how I could be causing this behavior.

    Read the article

  • How do I get mouse x / y of the world plane in Unity?

    - by Discipol
    I am trying to make a tiled landscape. The terrain itself is not made from tiles but the world has a grid which I define. I would like to place boxes/rectangles which snap to this grid, at runtime, but in order for me to do that I must get a projection from the user screen to the real-world coordinates. I have tried various examples using the Ray class but nothing worked. It compiles and outputs a constant value no matter where I put the mouse. I have tried to add some tiles and try to detect them but no luck. I also tried with one plane as big as my world but still no luck. I am using C# but even a JS version would be helpful. This technique involves calculating which tile the mouse is under by the x and y positions. Perhaps detecting which tile itself is being pointed to would be a simpler task, at which point I can just retrieve its i/j properties. Update: I got it working thanks to some answers, but the ball freaks out towards the far end of the plane. Why is this? https://www.dropbox.com/sh/9pqnl30lm6uwm6h/AACc2JcbW16z6PuHFLLfCAX6a

    Read the article

  • Inherited varibles are not reading correctly when using bitwise comparisons

    - by Shawn B
    Hey, I have a few classes set up for a game, with XMapObject as the base, and XEntity, XEnviron, and XItem inheriting it. MapObjects have a number of flags, one of them being MAPOBJECT_SOLID. My problem is, that XEntity is the only class that correctly detects MAPOBJECT_SOLID. Both Items are Environs are always considered solid by the game, regardless of the flag's state. What is important, is that Environs and Item should almost never be solid. Here are the relevent code samples: XMapObject: class XMapObject : public XObject { public: Uint8 MapObjectType,Location[2],MapObjectFlags; XMapObject *NextMapObject,*PrevMapObject; XMapObject(); void CreateMapObject(Uint8 MapObjectType); void SpawnMapObject(Uint8 MapObjectLocation[2]); void RemoveMapObject(); void DeleteMapObject(); void MapObjectSetLocation(Uint8 Y,Uint8 X); void MapObjectMapLink(); void MapObjectMapUnlink(); }; XEntity: class XEntity : public XMapObject { public: Uint8 Health,EntityFlags; float Speed,Time; XEntity *NextEntity,*PrevEntity; XItem *IventoryList; XEntity(); void CreateEntity(Uint8 EntityType,Uint8 EntityLocation[2]); void DeleteEntity(); void EntityLink(); void EntityUnlink(); Uint8 MoveEntity(Uint8 YOffset,Uint8 XOffset); }; XEnviron: class XEnviron : public XMapObject { public: Uint8 Effect,TimeOut; void CreateEnviron(Uint8 Type,Uint8 Y,Uint8 X,Uint8 TimeOut); }; XItem: class XItem : public XMapObject { public: void CreateItem(Uint8 Type,Uint8 Y,Uint8 X); }; And lastly, the entity move code. Only entities are capable of moving themselves. Uint8 XEntity::MoveEntity(Uint8 YOffset,Uint8 XOffset) { Uint8 NewY = Location[0] + YOffset, NewX = Location[1] + XOffset; if((NewY >= 0 && NewY < MAPY) && (NewX >= 0 && NewX < MAPX)) { XTile *Tile = GetTile(NewY,NewX); if(Tile->MapList != NULL) { XMapObject *MapObject = Tile->MapList; while(MapObject != NULL) { if(MapObject->MapObjectFlags & MAPOBJECT_SOLID) { printf("solid\n"); return 0; } MapObject = MapObject->NextMapObject; } } if(Tile->Flags & TILE_SOLID && EntityFlags & ENTITY_CLIPPING) { return 0; } this->MapObjectSetLocation(NewY,NewX); return 1; } return 0; } What is wierd, is that the bitwise operator always returns true when the MapObject is an Environ or an Item, but it works correctly for Entities. For debug I am using the printf "Solid", and also a printf containing the value of the flag for both Environs and Items. Any help is greatly appreciated, as this is a major bug for the small game I am working on.

    Read the article

  • Inherited variables are not reading correctly when using bitwise comparisons

    - by Shawn B
    Hey, I have a few classes set up for a game, with XMapObject as the base, and XEntity, XEnviron, and XItem inheriting it. MapObjects have a number of flags, one of them being MAPOBJECT_SOLID. My problem is that XEntity is the only class that correctly detects MAPOBJECT_SOLID. Both Items are Environs are always considered solid by the game, regardless of the flag's state. What is important is that Environs and Item should almost never be solid. Here are the relevent code samples: XMapObject: class XMapObject : public XObject { public: Uint8 MapObjectType,Location[2],MapObjectFlags; XMapObject *NextMapObject,*PrevMapObject; XMapObject(); void CreateMapObject(Uint8 MapObjectType); void SpawnMapObject(Uint8 MapObjectLocation[2]); void RemoveMapObject(); void DeleteMapObject(); void MapObjectSetLocation(Uint8 Y,Uint8 X); void MapObjectMapLink(); void MapObjectMapUnlink(); }; XEntity: class XEntity : public XMapObject { public: Uint8 Health,EntityFlags; float Speed,Time; XEntity *NextEntity,*PrevEntity; XItem *IventoryList; XEntity(); void CreateEntity(Uint8 EntityType,Uint8 EntityLocation[2]); void DeleteEntity(); void EntityLink(); void EntityUnlink(); Uint8 MoveEntity(Uint8 YOffset,Uint8 XOffset); }; XEnviron: class XEnviron : public XMapObject { public: Uint8 Effect,TimeOut; void CreateEnviron(Uint8 Type,Uint8 Y,Uint8 X,Uint8 TimeOut); }; XItem: class XItem : public XMapObject { public: void CreateItem(Uint8 Type,Uint8 Y,Uint8 X); }; And lastly, the entity move code. Only entities are capable of moving themselves. Uint8 XEntity::MoveEntity(Uint8 YOffset,Uint8 XOffset) { Uint8 NewY = Location[0] + YOffset, NewX = Location[1] + XOffset; if((NewY >= 0 && NewY < MAPY) && (NewX >= 0 && NewX < MAPX)) { XTile *Tile = GetTile(NewY,NewX); if(Tile->MapList != NULL) { XMapObject *MapObject = Tile->MapList; while(MapObject != NULL) { if(MapObject->MapObjectFlags & MAPOBJECT_SOLID) { printf("solid\n"); return 0; } MapObject = MapObject->NextMapObject; } } if(Tile->Flags & TILE_SOLID && EntityFlags & ENTITY_CLIPPING) { return 0; } this->MapObjectSetLocation(NewY,NewX); return 1; } return 0; } What is wierd, is that the bitwise operator always returns true when the MapObject is an Environ or an Item, but it works correctly for Entities. For debug I am using the printf "Solid", and also a printf containing the value of the flag for both Environs and Items. Any help is greatly appreciated, as this is a major bug for the small game I am working on.

    Read the article

  • Delaying execution of Javascript function relative to Google Maps / geoxml3 parser?

    - by Terra Fimeira
    I'm working on a implementing a Google map on a website with our own tiles overlays and KML elements. I've been previously requested to create code so that, for instance, when the page is loaded from a specific URL, it would initialize with one of the tile overlays already enabled. Recently, I've been requested to do the same for the buildings which are outlined by KML elements so that, arriving at the page with a specific URL, it would automatically zoom, center, and display information on the building. However, while starting with the tile overlays work, the building KML does not. After doing some testing, I've determined that when the code which checks the URL executes, the page is still loading the KML elements and thus do not exist for the code to compare to or use: Code for evaluating URL (placed at the end of onLoad="initialize()") function urlClick() { var currentURL = window.location.href; //Retrieve page URL var URLpiece = currentURL.slice(-6); //pull the last 6 digits (for testing) if (URLpiece === "access") { //If the resulting string is "access": access_click(); //Display accessibility overlay } else if (URLpiece === "middle") { //Else if the string is "middle": facetClick('Middle College'); //Click on building "Middle College" }; }; facetClick(); function facetClick(name) { //Convert building name to building ID. for (var i = 0; i < active.placemarks.length; i++) { if (active.placemarks[i].name === name) { sideClick(i) //Click building whose id matches "Middle College" }; }; }; Firebug Console Error active is null for (var i = 0; i < active.placemarks.length; i++) { active.placemarks is which KML elements are loaded on the page, and being null, means no KML has been loaded yet. In short, I have a mistiming and I can't seem to find a suitable place to place the URL code to execute after the KMl has loaded. As noted above, I placed it at the end of onLoad="initialize()", but it would appear that, instead of waiting for the KML to completely load earlier in the function, the remainder of the function is executed: onLoad="initialize()" information(); //Use the buttons variables inital state to set up description buttons(); //and button state button_hover(0); //and button description to neutral. //Create and arrange the Google Map. //Create basic tile overlays. //Set up parser to work with KML elements. myParser = new geoXML3.parser({ //Parser: Takes KML and converts to JS. map: map, //Applies parsed KML to the map singleInfoWindow: true, afterParse: useTheData //Allows us to use the parsed KML in a function }); myParser.parse(['/maps/kml/shapes.kml','/maps/kml/shapes_hidden.kml']); google.maps.event.addListener(map, 'maptypeid_changed', function() { autoOverlay(); }); //Create other tile overlays to appear over KML elements. urlClick(); I suspect one my issues lies in using the geoxml3 parser (http://code.google.com/p/geoxml3/) which converts our KML files to Javascript. While the page has completed loading all of the elements, the map on the page is still loading, including the KML elements. I have also tried placing urlClick() in the parser itself in various places which appear to execute after all the shapes have been parsed, but I've had no success there either. While I've been intending to strip out the parser, I would like to know if there is any way of executing the "urlClick" after the parser has returned the KML shapes. Ideally, I don't want to use an arbitrary means of defining a time to wait, such as "wait 3 seconds, and go", as my various browsers all load the page at different times; rather, I'm looking for some way to say "when the parser is done, execute" or "when the Google map is completely loaded, execute" or perhaps even "hold until the parser is complete before advancing to urlClick".

    Read the article

  • Preload/predisplay tiles in a CATiledLayer?

    - by jemmons
    On the iPhone (though I imagine it's an equally valid question in Cocoa) I have a UIScrollView around a UIView backed by a CATiledLayer. The way it works by default is to load any uncached/unfetched tiles when my viewport scrolls over a blank section of the CATiledLayer. What I would like to know is if there's a way to trigger CATiledLayer to load a tile that's not actively being displayed? I would like to, for example, preload all tiles contiguous to the currently displayed tile while they are still offscreen, thus avoiding flashing a blank screen that fades in to the image once it's loaded asynchronously. Any ideas?

    Read the article

  • Myfaces extensionfilter overriding renderkit? (Tree2 component)

    - by Mike
    I've pulled in the tree2 component (from Tomahawk 1.1.9). Had used the simpler Tree component on previous projects, and this one just looks a bit nicer. Running on websphere 6.1.x and set the server side flag that's needed (com.ibm.ws.webcontainer.invokefilterscompatibility=true) and set the extensionfilter accordingly. Everything's good, and works as expected. Here's the issue: - on a page being included on this one (just some typical footer type info with NO myfaces widgets), there's some embedded html that's getting flagged with warnings in the systemout console). These look like org.apache.myfaces.renderkit.html.util.ReducedHTMLParser parse Invalid tag found: unexpected input while looking for attr name or '/' at line 475. Surroundings: 'span id="tile:footr:viewFragm'. org.apache.myfaces.renderkit.html.util.ReducedHTMLParser parse Invalid tag found: unexpected input while looking for attr name or '/' at line 479. Surroundings: 'a id="tile:footr:viewFragment'. org.apache.myfaces.renderkit.html.util.ReducedHTMLParser parse Invalid tag found: unexpected input while looking for attr name or '/' at line 492. Surroundings: 'a id="tile:footr:viewFragment'. The problem isn't necessarily with the html (which should be cleaned up regardless :-). IF I don't include myfaces, I don't get these warning messages with the default ibm jsf renderer (using jsf 1.1 still). Obviously, IBM's implementation is a bit more lax than myFaces. The page has nothing to do with myfaces at all. The reason for needing the extension filter is that it needs (for the Tree2 anyways, I know it does more for file upload) to intercept requests and then stick some .js includes on the page. Investigated this a bit, and I've included this filter in my web.xml, but it is NO longer fronting the faces servlet. So, the filter is instantiated at startup, but is never executed. Since the filter isn't in place, I've had to hard code in the includes for the 2 .js files into my page Now, the tree2 gets rendered properly, AND I'm not getting the warnings from above, because with the extentionfilter not being called, its using the IBM renderkit ;-) I'm a bit concerned that when the extension filter is in place, everything is being rendered by myFaces, rather than IBM's renderkit (i.e. All I want is myfaces/tomahawk to render the tree2 only, and let the ri do everything else) Can anyone confirm this? When you use myfaces/tomahawk, is it doing all the rendering for the whole application, or just the page any tomahawk widget is on? Thanks for any thoughts on this mike

    Read the article

  • Plot hex tiles with different length sides?

    - by Phil
    I'm trying to create a basic grid of hex tiles. I found some code... s=h/Math.cos(30*Math.PI/180)/2; tile._x=x*s*1.5; tile._y=y*h+(x%2)*h/2; That does just that, but I think it's setup for hex's that have same length sides. However my hex has different length sides. It's width is 140 and it's height is 80. I could completely change the code to work with my side lengths, but I was wondering if there's a better way of doing it with the code above.

    Read the article

  • How to very efficiently assign lat/long to city boundary described by shape ?

    - by watcherFR
    I have a huge shapefile of 36.000 non-overlapping polygones (city boundaries). I want to easily determine the polygone into which a given lat/long falls. What would the best way given that it must be extremely computationaly efficient ? I was thinking of creating a lookup table (tilex,tiley,polygone_id) where tilex and tiley are tile identifiers at zoom levels 21 or 22. Yes, the lack of precision of using tile numbers and a planar projection is acceptable in my application. I would rather not use postgres's GIS extension and am fine with a program that will run for 2 days to generate all the INSERT statements.

    Read the article

  • using a tileset with canvas

    - by Anonymous
    Yeah so I'm lost from the get-go. Alright let's say I have a big image with every tile for a 2D top-down RPG game. They're all the same width and everything. What I don't know is how would I save every individual tile from that image to their own image data for use on the canvas? Basically I want to take a big image with all my tiles, choose squares throughout it to make images out of the tiles, and store each image as a variable in an array. So, how would I do this?

    Read the article

  • Unity: how to apply programmatical changes to the Terrain SplatPrototype?

    - by Shivan Dragon
    I have a script to which I add a Terrain object (I drag and drop the terrain in the public Terrain field). The Terrain is already setup in Unity to have 2 PaintTextures: 1 is a Square (set up with a tile size so that it forms a checkered pattern) and the 2nd one is a grass image: Also the Target Strength of the first PaintTexture is lowered so that the checkered pattern also reveals some of the grass underneath. Now I want, at run time, to change the Tile Size of the first PaintTexture, i.e. have more or less checkers depending on various run time conditions. I've looked through Unity's documentation and I've seen you have the Terrain.terrainData.SplatPrototype array which allows you to change this. Also there's a RefreshPrototypes() method on the terrainData object and a Flush() method on the Terrain object. So I made a script like this: public class AStarTerrain : MonoBehaviour { public int aStarCellColumns, aStarCellRows; public GameObject aStarCellHighlightPrefab; public GameObject aStarPathMarkerPrefab; public GameObject utilityRobotPrefab; public Terrain aStarTerrain; void Start () { //I've also tried NOT drag and dropping the Terrain on the public field //and instead just using the commented line below, but I get the same results //aStarTerrain = this.GetComponents<Terrain>()[0]; Debug.Log ("Got terrain "+aStarTerrain.name); SplatPrototype[] splatPrototypes = aStarTerrain.terrainData.splatPrototypes; Debug.Log("Terrain has "+splatPrototypes.Length+" splat prototypes"); SplatPrototype aStarCellSplat = splatPrototypes[0]; Debug.Log("Re-tyling splat prototype "+aStarCellSplat.texture.name); aStarCellSplat.tileSize = new Vector2(2000,2000); Debug.Log("Tyling is now "+aStarCellSplat.tileSize.x+"/"+aStarCellSplat.tileSize.y); aStarTerrain.terrainData.RefreshPrototypes(); aStarTerrain.Flush(); } //... Problem is, nothing gets changed, the checker map is not re-tiled. The console outputs correctly tell me that I've got the Terrain object with the right name, that it has the right number of splat prototypes and that I'm modifying the tileSize on the SplatPrototype object corresponding to the right texture. It also tells me the value has changed. But nothing gets updated in the actual graphical view. So please, what am I missing?

    Read the article

  • Spin-off of "Project: Memory++" in Khan academy [on hold]

    - by smraj
    This is the link of the program that I am trying https://www.khanacademy.org/cs/memory-tile-game/5966959895642112 When I am placing the mouse over the block it should change to red colour and when it is released the image should be displayed but my issue is that when i place the mouse over the block it changes its color ,but on release the image is not displayed.I kindly request someone in solving this

    Read the article

  • How to apply programatical changes to the Terrain SplatPrototype

    - by Shivan Dragon
    I have a script to which I add a Terrain object (I drag and drop the terrain in the public Terrain field). The Terrain is already setup in Unity to have 2 PaintTextures: 1 is a Square (set up with a tile size so that it forms a checkered pattern) and the 2nd one is a grass image: Also the Target Strength of the first PaintTexture is lowered so that the checkered pattern also reveals some of the grass underneath. Now I want, at run time, to change the Tile Size of the first PaintTexture, i.e. have more or less checkers depending on various run time conditions. I've looked through Unity's documentation and I've seen you have the Terrain.terrainData.SplatPrototype array which allows you to change this. Also there's a RefreshPrototypes() method on the terrainData object and a Flush() method on the Terrain object. So I made a script like this: public class AStarTerrain : MonoBehaviour { public int aStarCellColumns, aStarCellRows; public GameObject aStarCellHighlightPrefab; public GameObject aStarPathMarkerPrefab; public GameObject utilityRobotPrefab; public Terrain aStarTerrain; void Start () { //I've also tried NOT drag and dropping the Terrain on the public field //and instead just using the commented line below, but I get the same results //aStarTerrain = this.GetComponents<Terrain>()[0]; Debug.Log ("Got terrain "+aStarTerrain.name); SplatPrototype[] splatPrototypes = aStarTerrain.terrainData.splatPrototypes; Debug.Log("Terrain has "+splatPrototypes.Length+" splat prototypes"); SplatPrototype aStarCellSplat = splatPrototypes[0]; Debug.Log("Re-tyling splat prototype "+aStarCellSplat.texture.name); aStarCellSplat.tileSize = new Vector2(2000,2000); Debug.Log("Tyling is now "+aStarCellSplat.tileSize.x+"/"+aStarCellSplat.tileSize.y); aStarTerrain.terrainData.RefreshPrototypes(); aStarTerrain.Flush(); } //... Problem is, nothing gets changed, the checker map is not re-tiled. The console outputs correctly tell me that I've got the Terrain object with the right name, that it has the right number of splat prototypes and that I'm modifying the tileSize on the SplatPrototype object corresponding to the right texture. It also tells me the value has changed. But nothing gets updated in the actual graphical view. So please, what am I missing?

    Read the article

  • Windows Azure Virtual Machine Readiness and Capacity Assessment for SQL Server

    - by SQLOS Team
    Windows Azure Virtual Machine Readiness and Capacity Assessment for Windows Server Machine Running SQL Server With the release of MAP Toolkit 8.0 Beta, we have added a new scenario to assess your Windows Azure Virtual Machine Readiness. The MAP 8.0 Beta performs a comprehensive assessment of Windows Servers running SQL Server to determine you level of readiness to migrate an on-premise physical or virtual machine to Windows Azure Virtual Machines. The MAP Toolkit then offers suggested changes to prepare the machines for migration, such as upgrading the operating system or SQL Server. MAP Toolkit 8.0 Beta is available for download here Your participation and feedback is very important to make the MAP Toolkit work better for you. We encourage you to participate in the beta program and provide your feedback at [email protected] or through one of our surveys. Now, let’s walk through the MAP Toolkit task for completing the Windows Azure Virtual Machine assessment and capacity planning. The tasks include the following: Perform an inventory View the Windows Azure VM Readiness results and report Collect performance data for determine VM sizing View the Windows Azure Capacity results and report Perform an inventory: 1. To perform an inventory against a single machine or across a complete environment, choose Perform an Inventory to launch the Inventory and Assessment Wizard as shown below: 2. After the Inventory and Assessment Wizard launches, select either the Windows computers or SQL Server scenario to inventory Windows machines. HINT: If you don’t care about completely inventorying a machine, just select the SQL Server scenario. Click Next to Continue. 3. On the Discovery Methods page, select how you want to discover computers and then click Next to continue. Description of Discovery Methods: Use Active Directory Domain Services -- This method allows you to query a domain controller via the Lightweight Directory Access Protocol (LDAP) and select computers in all or specific domains, containers, or OUs. Use this method if all computers and devices are in AD DS. Windows networking protocols --  This method uses the WIN32 LAN Manager application programming interfaces to query the Computer Browser service for computers in workgroups and Windows NT 4.0–based domains. If the computers on the network are not joined to an Active Directory domain, use only the Windows networking protocols option to find computers. System Center Configuration Manager (SCCM) -- This method enables you to inventory computers managed by System Center Configuration Manager (SCCM). You need to provide credentials to the System Center Configuration Manager server in order to inventory the managed computers. When you select this option, the MAP Toolkit will query SCCM for a list of computers and then MAP will connect to these computers. Scan an IP address range -- This method allows you to specify the starting address and ending address of an IP address range. The wizard will then scan all IP addresses in the range and inventory only those computers. Note: This option can perform poorly, if many IP addresses aren’t being used within the range. Manually enter computer names and credentials -- Use this method if you want to inventory a small number of specific computers. Import computer names from a files -- Using this method, you can create a text file with a list of computer names that will be inventoried. 4. On the All Computers Credentials page, enter the accounts that have administrator rights to connect to the discovered machines. This does not need to a domain account, but needs to be a local administrator. I have entered my domain account that is an administrator on my local machine. Click Next after one or more accounts have been added. NOTE: The MAP Toolkit primarily uses Windows Management Instrumentation (WMI) to collect hardware, device, and software information from the remote computers. In order for the MAP Toolkit to successfully connect and inventory computers in your environment, you have to configure your machines to inventory through WMI and also allow your firewall to enable remote access through WMI. The MAP Toolkit also requires remote registry access for certain assessments. In addition to enabling WMI, you need accounts with administrative privileges to access desktops and servers in your environment. 5. On the Credentials Order page, select the order in which want the MAP Toolkit to connect to the machine and SQL Server. Generally just accept the defaults and click Next. 6. On the Enter Computers Manually page, click Create to pull up at dialog to enter one or more computer names. 7. On the Summary page confirm your settings and then click Finish. After clicking Finish the inventory process will start, as shown below: Windows Azure Readiness results and report After the inventory progress has completed, you can review the results under the Database scenario. On the tile, you will see the number of Windows Server machine with SQL Server that were analyzed, the number of machines that are ready to move without changes and the number of machines that require further changes. If you click this Azure VM Readiness tile, you will see additional details and can generate the Windows Azure VM Readiness Report. After the report is generated, select View | Saved Reports and Proposals to view the location of the report. Open up WindowsAzureVMReadiness* report in Excel. On the Windows tab, you can see the results of the assessment. This report has a column for the Operating System and SQL Server assessment and provides a recommendation on how to resolve, if there a component is not supported. Collect Performance Data Launch the Performance Wizard to collect performance information for the Windows Server machines that you would like the MAP Toolkit to suggest a Windows Azure VM size for. Windows Azure Capacity results and report After the performance metrics are collected, the Azure VM Capacity title will display the number of Virtual Machine sizes that are suggested for the Windows Server and Linux machines that were analyzed. You can then click on the Azure VM Capacity tile to see the capacity details and generate the Windows Azure VM Capacity Report. Within this report, you can view the performance data that was collected and the Virtual Machine sizes.   MAP Toolkit 8.0 Beta is available for download here Your participation and feedback is very important to make the MAP Toolkit work better for you. We encourage you to participate in the beta program and provide your feedback at [email protected] or through one of our surveys. Useful References: Windows Azure Homepage How to guides for Windows Azure Virtual Machines Provisioning a SQL Server Virtual Machine on Windows Azure Windows Azure Pricing     Peter Saddow Senior Program Manager – MAP Toolkit Team

    Read the article

  • Sortie de GCC 4.7 : pour ses 25 ans, le compilateur expérimente la gestion de la mémoire transactionnelle

    Richard Stallman vient d'annoncer la sortie de gcc 4.7, qui coïncide avec l'anniversaire des 25 ans de ce célèbre compilateur. Cette nouvelle version propose de nombreuses nouveautés : - l'intégration (expérimentale) de la gestion de la mémoire transactionnelle - la prise en charge de nouvelles architectures (Haswell avec AVX2, Piledriver, ARM et Cortext-A7, SPARC, CR16, C6X, TILE-Gx et TILEPro) - l'amélioration de plusieurs langages et bibliothèques : C++11 (modèle de mémoire et atomics, initializer pour les données membres non-static, littérales définies par l'utilisateur, alias-declarations, delegating constructors, explicit override et syntaxe étendue de friend), C11, Fortran, OpenMP 3.1, amélioration du link-time optimization (LTO) - ...

    Read the article

  • 2D game editor with SDK or open format (Windows)

    - by Edward83
    I need 2d editor (Windows) for game like rpg. Mostly important features for me: Load tiles as classes with attributes, for example "tile1 with coordinates [25,30] is object of class FlyingMonster with speed=1.0f"; Export map to my own format (SDK) or open format which I can convert to my own; As good extension feature will be multi-tile brush. I wanna to choose one or many tiles into one brush and spread it on canvas.

    Read the article

  • Better data structure for a game like Bubble Witch

    - by CrociDB
    I'm implementing a bubble-witch-like game (http://www.king.com/games/puzzle-games/bubble-witch/), and I was thinking on what's the better way to store the "bubbles" and to work with. I thought of using graphs, but that might be too complex for a trivial thing. Thought of a matrix, just like a tile map, but that might get too 'workaroundy'. I don't know. I'll be doing in Flash/AS3, though. Thanks. :)

    Read the article

  • Smoothing found path on grid

    - by Denis Ermolin
    I implemented several approaches such as A* and Potential fields for my tower defense game. But I want smooth paths, first I tried to find path on very small grid ( 5x5 pixels per tile) but it is extremly slow. I found nice video showing an RTS demo where paths are found on big grid but units dont move from each cell's center to center. How do I implement such behavior? Some examples would be great.

    Read the article

< Previous Page | 13 14 15 16 17 18 19 20 21 22 23 24  | Next Page >