Search Results

Search found 8 results on 1 pages for 'dbomb101'.

Page 1/1 | 1 

  • x axis detection issues platformer starter kit

    - by dbomb101
    I've come across a problem with the collision detection code in the platformer starter kit for xna.It will send up the impassible flag on the x axis despite being nowhere near a wall in either direction on the x axis, could someone could tell me why this happens ? Here is the collision method. /// <summary> /// Detects and resolves all collisions between the player and his neighboring /// tiles. When a collision is detected, the player is pushed away along one /// axis to prevent overlapping. There is some special logic for the Y axis to /// handle platforms which behave differently depending on direction of movement. /// </summary> private void HandleCollisions() { // Get the player's bounding rectangle and find neighboring tiles. Rectangle bounds = BoundingRectangle; int leftTile = (int)Math.Floor((float)bounds.Left / Tile.Width); int rightTile = (int)Math.Ceiling(((float)bounds.Right / Tile.Width)) - 1; int topTile = (int)Math.Floor((float)bounds.Top / Tile.Height); int bottomTile = (int)Math.Ceiling(((float)bounds.Bottom / Tile.Height)) - 1; // Reset flag to search for ground collision. isOnGround = false; // For each potentially colliding tile, for (int y = topTile; y <= bottomTile; ++y) { for (int x = leftTile; x <= rightTile; ++x) { // If this tile is collidable, TileCollision collision = Level.GetCollision(x, y); if (collision != TileCollision.Passable) { // Determine collision depth (with direction) and magnitude. Rectangle tileBounds = Level.GetBounds(x, y); Vector2 depth = RectangleExtensions.GetIntersectionDepth(bounds, tileBounds); if (depth != Vector2.Zero) { float absDepthX = Math.Abs(depth.X); float absDepthY = Math.Abs(depth.Y); // Resolve the collision along the shallow axis. if (absDepthY < absDepthX || collision == TileCollision.Platform) { // If we crossed the top of a tile, we are on the ground. if (previousBottom <= tileBounds.Top) isOnGround = true; // Ignore platforms, unless we are on the ground. if (collision == TileCollision.Impassable || IsOnGround) { // Resolve the collision along the Y axis. Position = new Vector2(Position.X, Position.Y + depth.Y); // Perform further collisions with the new bounds. bounds = BoundingRectangle; } } //This is the section which deals with collision on the x-axis else if (collision == TileCollision.Impassable) // Ignore platforms. { // Resolve the collision along the X axis. Position = new Vector2(Position.X + depth.X, Position.Y); // Perform further collisions with the new bounds. bounds = BoundingRectangle; } } } } } // Save the new bounds bottom. previousBottom = bounds.Bottom; }

    Read the article

  • Is this masters course worth taking?

    - by dbomb101
    I've been spending the last couple of years developing 2D game in XNA but there are still alot of gaps in my knowledge especially in terms of 3D development and working in game development teams and I would like to eventually be able to develop more technically advanced games. I was thinking of taking the masters course linked below to help out with that. Do you think the course is worth it or should I simply continue self studying ? Course Details

    Read the article

  • string comparison xslt sheet

    - by dbomb101
    I am trying to compare a value which was grabbed using the get method in a form and then passed into a xslt sheet. I named the string variable passed in browse. I want to check if the variable browse has a string value browse. the code is below <xsl:if test="$browse = 'browse' "> <A> <xsl:attribute name="href">searchPage.php?search=<xsl:value-of select="$search" />&amp;browseButton=Browse&amp;XML=Xml&amp;page=<xsl:value-of select="number($Page)-1"/>&amp;pagesize=<xsl:value-of select="$PageSize"/></xsl:attribute> &lt;&lt;Prev </A> </xsl:if>

    Read the article

  • XML creation using DOM and MYSQL

    - by dbomb101
    I am trying to create a XML document from information extracted from a mysql table. I am using a tutorial to accomplish this http://www.tonymarston.net/php-mysql/dom.html#a5 what I want to do is to create each element separately, instead of creating them all at once as shown in the tutorial. In order to do that I am trying to place the specific field name into the foreach loop below, any help would be greatly appreciated. foreach ($row as where fieldname should go => $row['artistname']) { $artval = $doc->createTextNode($row['artistname']); $artval = $chil->appendChild($val); }

    Read the article

  • XSLT Pagination

    - by dbomb101
    I have created a xslt document which formats an xml document, but I would like the results from the xslt sheet to be paginated. here is the orginal xlst document <?xml version="1.0" encoding="UTF-8"?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="yes"/> <xsl:template match="/"> <xsl:for-each select="musicInformation/musicdetails"> <label for="artistname{position()}" id="artistnameLabel{position()}">Artist Name:</label> <span id ="artistname{position()}"><xsl:value-of select="artistname" /></span> <br/> <label for="recordname{position()}" id="recordnameLabel{position()}">Record Name:</label> <span id ="recordname{position()}"><xsl:value-of select="recordname" /></span> <br/> <label for="recordtype{position()}" id="recordtypeLabel{position()}">Record Type:</label> <span id ="recordtype{position()}"><xsl:value-of select="recordtype" /></span> <br/> <label for="format{position()}" id="formatLabel{position()}">Format:</label> <span id ="format{position()}"><xsl:value-of select="format" /></span> <br/> <a href="xmlDetail.php?mid={@m_id}" >See Details</a> <br/><br/> </xsl:for-each> </xsl:template> </xsl:stylesheet>

    Read the article

  • searching XML documents using php

    - by dbomb101
    I am trying to make a search function using the combination of DOM, PHP and XML. I got something up and running but the problem is that my search function will only accept exact terms, on top of this am wondering if the method I picked the most efficient $searchTerm = "Lupe"; $doc = new DOMDocument(); foreach (file('musicInformation.xml')as $node) { $xmlString .= trim($node); } $doc->loadXML($xmlString); $records = $doc->documentElement->childNodes; $records = $doc->getElementsByTagName("musicdetails"); foreach( $records as $record ) { $artistnames = $record->getElementsByTagName("artistname"); $artistname = $artistnames->item(0)->nodeValue; $recordnames = $record->getElementsByTagName("recordname"); $recordname = $recordnames->item(0)->nodeValue; $recordtypes = $record->getElementsByTagName("recrodtype"); $recordtype = $recordtypes->item(0)->nodeValue; $formats = $record->getElementsByTagName("format"); $format = $formats->item(0)->nodeValue; $prices = $record->getElementsByTagName("price"); $price = $prices->item(0)->nodeValue; if($searchTerm == $artistname|| $searchTerm == $recordname || $searchTerm == $recordtype ||$searchTerm == $format || $searchTerm == $price) { echo "$artistname - $recordname - $recordtype - $format -$price\n"; }

    Read the article

  • proper link formatting

    - by dbomb101
    I am trying to create a link, which will, allow my paginated search to go onto the next page of results including the search term in the url I get the following error with the link I have created Parse error: syntax error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING in /home/dd615/public_html/searchPage.php on line 47 here is the link echo "<a href='{$_SERVER['PHP_SELF']}?search=$_GET['search']?pagenumber=1'> FIRST </a>"; any help would be greatly appreciated

    Read the article

  • GUI options for emulator c++

    - by dbomb101
    I want to create a Gameboy emulator which runs directly from the exe file, in a similar fashion to visualboy advance. I was wondering in terms of creating a GUI interface for the emulator what would be the best option to accomplish this ?

    Read the article

1