Search Results

Search found 106 results on 5 pages for 'coin'.

Page 2/5 | < Previous Page | 1 2 3 4 5  | Next Page >

  • What is this JavaScript gibberish?

    - by W3Geek
    I am studying how to make a 2D game with JavaScript by reading open source JavaScript games and I came across this gibberish... aSpriteData = [ "}\"¹-º\"À+º\"À+º\"À+º\"¿¤À ~C_ +º\"À+º\"À+º\"À*P7²OK%¾+½u_\"À<¡a¡a¡bM@±@ª", // 0 ground "a ' ![± 7°³b£[mt<Nµ7z]~¨OR»[f_7l},tl},+}%XN²Sb[bl£[±%Y_¹ !@ $", // 1 qbox "!A % @,[] ±}°@;µn¦&X£ <$ §¤ 8}}@Prc'U#Z'H'@· ¶\"is ¤&08@£(", // 2 mario " ´!A.@H#q8¸»e-½n®@±oW:&X¢a<&bbX~# }LWP41}k¬#3¨q#1f RQ@@:4@$", // 3 mario jump " 40 q$!hWa-½n¦#_Y}a©,0#aaPw@=cmY<mq©GBagaq&@q#0§0t0¤ $", // 4 mario run "+hP_@", // 5 pipe left "¢,6< R¤", // 6 pipe right "@ & ,'+hP?>³®'©}[!»¹.¢_^¥y/pX¸#µ°=a¾½hP?>³®'©}[!»¹.¢_^ Ba a", // 7 pipe top left "@ , !] \"º £] , 8O #7a&+¢ §²!cº 9] P &O ,4 e", // 8 pipe top right " £ #! ,! P!!vawd/XO¤8¼'¤P½»¹²'9¨ \"P²Pa²(!¢5!N*(4´b!Gk(a", // 9 goomba " Xu X5 =ou!¯­¬a[Z¼q.°u#|xv ¸··@=~^H'WOJ!¯­¬a=Nu ²J <J a", // 10 coin // yui "@ & !MX ~L \"y %P *¢ 5a K w !L \"y %P *­a%¬¢ 4 a", // 11 ebox // yui "¢ ,\"²+aN!@ &7 }\"²+aN!XH # }\"²+aN!X% 8}\"²+aN!X%£@ (", // 12 bricks "} %¿¢!N° I¨²*<P%.8\"h,!Cg r¥ H³a4X¢*<P%.H#I¬ :a!u !q", // 13 block makeSpace(20) + "4a }@ }0 N( w$ }\" N! +aa", // 14 bush left " r \"²y!L%aN zPN NyN#²L}[/cy¾ N" + makeSpace(18) + "@", // 15 bush mid makeSpace(18) + "++ !R·a!x6 &+6 87L ¢6 P+ 8+ (", // 16 bush right " %©¦ +pq 7> \"³ s" + makeSpace(25) + "@", // 17 cloud bottom left "a/a_#².Q¥'¥b}8.£¨7!X\"K+5cqs%(" + makeSpace(18) + "0", // 18 cloud bottom mid "bP ¢L P+ 8%a,*a%§@ J" + makeSpace(22) + "(", // 19 cloud bottom right "", // 20 mushroom "", // koopa 16x24 "", // 22 star "", // 23 flagpole "", // 24 flag "", // 25 flagpole top " 6 ~ }a }@ }0 }( }$ }\" }! } a} @} 0} (} $} \"² $", // 26 hill slope "a } \"m %8 *P!MF 5la\"y %P" + makeSpace(18) + "(", // 27 hill mid makeSpace(30) + "%\" t!DK \"q", // 28 hill top "", // 29 castle bricks "", // 30 castle doorway bottom "", // 31 castle doorway top "", // 32 castle top "", // 33 castle top 2 "", // 34 castle window right "", // 35 castle window left "", // 36 castle flag makeSpace(19) + "8@# (9F*RSf.8 A¢$!¢040HD", // 37 goomba flat " *(!¬#q³¡[_´Yp~¡=<¥g=&'PaS²¿ Sbq*<I#*£Ld%Ryd%¼½e8H8bf#0a", // 38 mario dead " = ³ #b 'N¶ Z½Z Z½Z Z½Z Z½Z Z½Z Z½Z =[q ²@ ³ ¶ 0", // 39 coin step 1 " ?@ /q /e '¤ #³ !ºa }@ N0 ?( /e '¤ #³ ¿ _a \"", // 40 coin step 2 " / > ] º !² #¢ %a + > ] º !² #¢ 'a \"", // 41 coin step 3 " 7¢ +² *] %> \"p !Ga t¢ I² 4º *] %> \"p ¡ Oa \"" // 42 coin step 4 ], What does it do? If you want to look at the source file here it is: http://www.nihilogic.dk/labs/mario/mario.js Beware, there is more gibberish inside. I can't seem to make sense of any of it. Thank you.

    Read the article

  • How To Scale Canvas In Android

    - by Daniel Braithwaite
    I am writing a android game using Canvas as the way to draw everything, the problem is that when i run it on different android phones the canvas dosn't change size i tried using canvas.scale() but that didn't make a i difference. The code i use for drawing is ... public void draw( Canvas c, int score ) { Obstical2[] obstmp = Queue.toArray(this.o); Coin[] cointmp = QueueC.toArray(this.c); for( int i = 0; i < obstmp.length; i++ ) { obstmp[i].draw(c); } for( int i = 0; i < cointmp.length; i++ ) { cointmp[i].draw(c); } c.drawText(String.format("%d", score ), 20, 50, textPaint); if( isWon && isStarted ) c.drawText("YOU WON", 20, 400, resPaint); else if( isLost && isStarted ) c.drawText("YOU LOST", 20, 400, resPaint); } The function above calls the draw functions for the entity's on the screen, theses function are as follows Draw Function For Obstical : public void draw( Canvas c ) { Log.i("D", "COIN"); coin.draw(c); } Draw Function For Coin : public void draw( Canvas c ) { obstical.draw(c); } How could i make the canvas re-size to it would look the same on any screen ? Cheers Daniel

    Read the article

  • session indicator icon goes wrong after I upgrade to 12.10

    - by CoIn
    I upgraded my 12.04 to 12.10 yesterday, everything goes fine. But I found the little gear icon of session indicator was show incorrectly. I've re-installed the indicator-session package and changed to default theme but the problem remains. It's not a big problem but it is just annoying, hope you guys can help me! oops! I don't have enough reputation to post a image! You may move to this link to see it, thanks http://www.flickr.com/photos/flowfox/8115089204/

    Read the article

  • SQL Server Full Text Search Leading Wildcard

    - by aherrick
    After taking a look at this SO question and doing my own research, it appears that you cannot have a leading wildcard while using full text search. So in the most simple example, if I have a Table with 1 column like below: TABLE1 coin coinage undercoin select COLUMN1 from TABLE1 where COLUMN1 LIKE '%coin%' Would get me the results I want. How can I get the exact same results with FULL TEXT SEARCH enabled on the column? The following two queries return the exact same data, which is not exactly what I want. SELECT COLUMN1 FROM TABLE1 WHERE CONTAINS(COLUMN1, '"coin*"') SELECT COLUMN1 FROM TABLE1 WHERE CONTAINS(COLUMN1, '"*coin*"')

    Read the article

  • Edge Detection on Screen

    - by user2056745
    I have a edge collision problem with a simple game that i am developing. Its about throwing a coin across the screen. I am using the code below to detect edge collisions so i can make the coin bounce from the edges of the screen. Everything works as i want except one case. When the coin hits left edge and goes to right edge the system doesnt detect the collision. The rest cases are working perfectly, like hitting the right edge first and then the left edge. Can someone suggest a solution for it? public void onMove(float dx, float dy) { coinX += dx; coinY += dy; if (coinX > rightBorder) { coinX = ((rightBorder - coinX) / 3) + rightBorder; } if (coinX < leftBorder) { coinX = -(coinX) / 3; } if (coinY > bottomBorder) { coinY = ((bottomBorder - coinY) / 3) + bottomBorder; } invalidate(); }

    Read the article

  • Implementing Skip List in C++

    - by trikker
    [SOLVED] So I decided to try and create a sorted doubly linked skip list... I'm pretty sure I have a good grasp of how it works. When you insert x the program searches the base list for the appropriate place to put x (since it is sorted), (conceptually) flips a coin, and if the "coin" lands on a then that element is added to the list above it(or a new list is created with element in it), linked to the element below it, and the coin is flipped again, etc. If the "coin" lands on b at anytime then the insertion is over. You must also have a -infinite stored in every list as the starting point so that it isn't possible to insert a value that is less than the starting point (meaning that it could never be found.) To search for x, you start at the "top-left" (highest list lowest value) and "move right" to the next element. If the value is less than x than you continue to the next element, etc. until you have "gone too far" and the value is greater than x. In this case you go back to the last element and move down a level, continuing this chain until you either find x or x is never found. To delete x you simply search x and delete it every time it comes up in the lists. For now, I'm simply going to make a skip list that stores numbers. I don't think there is anything in the STL that can assist me, so I will need to create a class List that holds an integer value and has member functions, search, delete, and insert. The problem I'm having is dealing with links. I'm pretty sure I could create a class to handle the "horizontal" links with a pointer to the previous element and the element in front, but I'm not sure how to deal with the "vertical" links (point to corresponding element in other list?) If any of my logic is flawed please tell me, but my main questions are: How to deal with vertical links and whether my link idea is correct Now that I read my class List idea I'm thinking that a List should hold a vector of integers rather than a single integer. In fact I'm pretty positive, but would just like some validation. I'm assuming the coin flip would simply call int function where rand()%2 returns a value of 0 or 1 and if it's 0 then a the value "levels up" and if it's 0 then the insert is over. Is this incorrect? How to store a value similar to -infinite? Edit: I've started writing some code and am considering how to handle the List constructor....I'm guessing that on its construction, the "-infinite" value should be stored in the vectorname[0] element and I can just call insert on it after its creation to put the x in the appropriate place.

    Read the article

  • Find a better control

    - by Budda
    It is necessary to implement the following functionality: There is a rectangle "field", its size is 150x100 pixels. Field is split to locations, each location is 10x10 (totally 15x10 locations on the field). There are few "coins" (5, for example), each of them can be dropped into any location. The list of text messages should be displayed in the drop-down list if any coin is clicked (when any message is clicked, drop-down list should be hidden and coin should display the number of selected message from 0 to 9, for example). That should be done with Silverlight 4.0 I am going to implement custom control "Coin", it will have a view (with a circle), it will display some kind of popup-window (please advise, which one), focus will be set to this window. On "FocusLost" window will be closed (without changing message number), if any message from the list will be clicked then its number will be stored inside of coin. Question 1: is there any control that already has required functionality? Question 2: how to implement "drag-and-drop" of coins to the "field" (lets assume, they will be close to the field)? Any thought or ideas will be helpful. Thanks.

    Read the article

  • Array Undefined index error (notice) in PHP

    - by Alex
    I have this function: function coin_matrix($test, $revs) { $coin = array(); for ($i = 0; $i < count($test); $i++) { foreach ($revs as $j => $rev) { foreach ($revs as $k => $rev) { if ($j != $k && $test[$i][$j] != null && $test[$i][$k] != null) { $coin[$test[$i][$j]][$test[$i][$k]] += 1 / ($some_var - 1); } } } } return $coin; } where $test = array( array('3'=>'1','5'=>'1'), array('3'=>'2','5'=>'2'), array('3'=>'1','5'=>'2'), array('3'=>'1','5'=>'1')); and $revs = array('3'=>'A','5'=>'B'); the problem is that when I run it, it returns these errors (notices): Notice: Undefined index: 1 at line 10 Notice: Undefined index: 1 at line 10 Notice: Undefined index: 2 at line 10 Notice: Undefined index: 2 at line 10 Notice: Undefined index: 2 at line 10 Notice: Undefined index: 1 at line 10 which is this line: $coin[$test[$i][$j]][$test[$i][$k]] += 1 / ($some_var - 1); Any suggestion is greatly appreciated! Thanks!

    Read the article

  • Static Analyzer says I have a leak....why?

    - by Walter
    I think this code should be fine but Static Analyzer doesn't like it. I can't figure out why and was hoping that someone could help me understand. The code works fine, the analyzer result just bugs me. Coin *tempCoin = [[Coin alloc] initalize]; self.myCoin = tempCoin; [tempCoin release]; Coin is a generic NSObject and it has an initalize method. myCoin is a property of the current view and is of type Coin. I assume it is telling me I am leaking tempCoin. In my view's .h I have set myCoin as a property with nonatomic,retain. I've tried to autorelease the code as well as this normal release but Static Analyzer continues to say: 1. Method returns an Objective-C object with a +1 retain count (owning reference) 2. Object allocated on line 97 is no longer referenced after this point and has a retain count of +1 (object leaked) Line 97 is the first line that I show.

    Read the article

  • Subquery with multiple results combined into a single field?

    - by Todd
    Assume I have these tables, from which i need to display search results in a browser: Table: Containers id | name 1 Big Box 2 Grocery Bag 3 Envelope 4 Zip Lock Table: Sale id | date | containerid 1 20100101 1 2 20100102 2 3 20091201 3 4 20091115 4 Table: Items id | name | saleid 1 Barbie Doll 1 2 Coin 3 3 Pop-Top 4 4 Barbie Doll 2 5 Coin 4 I need output that looks like this: itemid itemname saleids saledates containerids containertypes 1 Barbie Doll 1,2 20100101,20100102 1,2 Big Box, Grocery Bag 2 Coin 3,4 20091201,20091115 3,4 Envelope, Zip Lock 3 Pop-Top 4 20091115 4 Zip Lock The important part is that each item type only gets one record/row in the return on the screen. I accomplished this in the past by returning multiple rows of the same item and using a scripting language to limit the output. However, this makes the ui overly complicated and loopy. So, I'm hoping I can get the database to spit out only as many records as there are rows to display. This example may be a bit extreme because of the 2 joins needed to get to the container from the item (through the sale table). I'd be happy for just an example query that outputs this: itemid itemname saleids saledates 1 Barbie Doll 1,2 20100101,20100102 2 Coin 3,4 20091201,20091115 3 Pop-Top 4 20091115 I can only return a single result in a subquery, so I'm not sure how to do this.

    Read the article

  • Having troubles inheriting base class

    - by Nick
    When I inherit the base class, it's telling me there is no such class This is enhanced.h: class enhanced: public changeDispenser // <--------where error is occuring { public: void changeStatus(); // Function: Lets the user know how much of each coin is in the machine enhanced(int); // Constructor // Sets the Dollar amount to what the User wants void changeLoad(int); // Function: Loads what change the user requests into the Coin Machine int dispenseChange(int); // Function: Takes the users amount of cents requests and dispenses it to the user private: int dollar; }; This is enhanced.cpp: #include "enhanced.h" #include <iostream> using namespace std; enhanced::enhanced(int dol) { dollar = dol; } void enhanced::changeStatus() { cout << dollar << " dollars, "; changeDispenser::changeStatus(); } void enhanced::changeLoad(int d) { dollar = dollar + d; //changeDispenser::changeLoad; } This is changeDispenser.h: class changeDispenser { public: void changeStatus(); // Function: Lets the user know how much of each coin is in the machine changeDispenser(int, int, int, int); // Constructor // Sets the Quarters, Dimes, Nickels, and Pennies to what the User wants void changeLoad(int, int, int, int); // Function: Loads what change the user requests into the Coin Machine int dispenseChange(int); // Function: Takes the users amount of cents requests and dispenses it to the user private: int quarter; int dime; int nickel; int penny; }; I didn't include the driver file or the changeDispenser imp file, but in the driver, these are included #include "changeDispenser.h" #include "enhanced.h"

    Read the article

  • Finding an odd perfect number

    - by Coin Bird
    I wrote these two methods to determine if a number is perfect. My prof wants me to combine them to find out if there is an odd perfect number. I know there isn't one(that is known), but I need to actually write the code to prove that. The issue is with my main method. I tested the two test methods. I tried debugging and it gets stuck on the number 5, though I can't figure out why. Here is my code: public class Lab6 { public static void main (String[]args) { int testNum = 3; while (testNum != sum_of_divisors(testNum) && testNum%2 != 0) testNum++; } public static int sum_of_divisors(int numDiv) { int count = 1; int totalDivisors = 0; while (count < numDiv) if (numDiv%count == 0) { totalDivisors = totalDivisors + count; count++; } else count++; return totalDivisors; } public static boolean is_perfect(int numPerfect) { int count = 1; int totalPerfect = 0; while (totalPerfect < numPerfect) { totalPerfect = totalPerfect + count; count++; } if (numPerfect == totalPerfect) return true; else return false; } }

    Read the article

  • Critique of SEO of this HTML

    - by Tom Gullen
    I'm designing a new site which I want to be as SEO friendly as possible, fast and responsive, semantic and very accessible. A lot of these things, embarrassingly are quite new to me. Have I miss applied anything? I want the template to be perfect. Live demo: http://69.24.73.172/demos/newDemo/ HTML: <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8" /> <title>Welcome to Scirra.com</title> <meta name="description" content="Construct 2, the HTML5 games creator." /> <meta name="keywords" content="game maker, game builder, html5, create games, games creator" /> <link rel="stylesheet" href="css/default.css" type="text/css" /> <link rel="stylesheet" href="plugins/coin-slider/coin-slider-styles.css" type="text/css" /> </head> <body> <div class="topBar"></div> <div class="mainBox"> <header> <div class="headWrapper"> <div class="s searchWrap"> <input type="text" name="SearchBox" id="SearchBox" tabindex="1" /> <div class="s searchIco"></div> </div> <!-- Logo placeholder --> </div> <div class="menuWrapper"><nav> <ul class="mainMenu"> <li><a href="#">Home</a></li> <li><a href="#">Forum</a></li> <li><a href="#" class="mainSelected">Construct</a></li> <li><a href="#">Arcade</a></li> <li><a href="#">Manual</a></li> </ul> <ul class="underMenu"> <li><a href="#">Homepage</a></li> <li><a href="#" class="underSelected">Construct</a></li> <li><a href="#">Products</a></li> <li><a href="#">Community Forum</a></li> <li><a href="#">Contact Us</a></li> </ul> </nav></div> </header> <div class="contentWrapper"> <div class="wideCol"> <div id="coin-slider" class="slideShowWrapper"> <a href="#" target="_blank"> <img src="images/screenshot1.jpg" alt="Screenshot" /> <span> Scirra software allows you to bring your imagination to life </span> </a> <a href="#"> <img src="images/screenshot2.jpg" alt="Screenshot" /> <span> Export your creations to HTML5 pages </span> </a> <a href="#"> <img src="images/screenshot3.jpg" alt="Screenshot" /> <span> Another description of some image </span> </a> <a href="#"> <img src="images/screenshot4.jpg" alt="Screenshot" /> <span> Something motivational to tell people </span> </a> </div> <div class="newsWrapper"> <h2>Latest from Twitter</h2> <div id="twitterFeed"> <p>The news on the block is this. Something has happened some news or something. <span class="smallDate">About 6 hours ago</span></p> <p>Another thing has happened lets tell the world some news or something. Lots to think about. Lots to do.<span class="smallDate">About 6 hours ago</span></p> <p>Shocker! Santa Claus is not real. This is breaking news, we must spread it. <span class="smallDate">About 6 hours ago</span></p> </div> </div> </div> <div class="thinCol"> <h1>Main Heading</h1> <p>Some paragraph goes here. It tells you about the picture. Cool! Have you thought about downloading Construct 2? Well you can download it with the link below. This column will expand vertically.</p> <h3>Help Me!</h3> <p>This column will keep expanging and expanging. It pads stuff out to make other things look good imo.</p> <h3>Why Download?</h3> <p>As well as other features, we also have some other features. Check out our <a href="#">other features</a>. Each of our other features is really cool and there to help everyone suceed.</p> <a href="#" class="s downloadBox" title="Download Construct 2 Now"> <div class="downloadHead">Download</div> <div class="downloadSize">24.5 MB</div> </a> </div> <div class="clear"></div> <h2>This Weeks Spotlight</h2> <div class="halfColWrapper"> <img src="images/spotlight1.png" class="spotLightImg" alt="Spotlight User" /> <p>Our spotlight member this week is Pooh-Bah. He writes good stuff. Read it. <a class="moreInfoLink" href="#">Learn More</a></p> </div> <div class="halfColWrapper r"> <img src="images/spotlight2.png" class="spotLightImg" alt="Spotlight Game" /> <p>Killer Bears is a scary ass game from JimmyJones. How many bears can you escape from? <a class="moreInfoLink" href="#">Learn More</a></p> </div> <div class="clear"></div> </div> </div><div class="mainEnder"></div> <footer> <div class="footerWrapper"> <div class="footerBox"> <div class="footerItem"> <h4>Community</h4> <ul> <li><a href="#">The Blog</a></li> <li><a href="#">Community Forum</a></li> <li><a href="#">RSS Feed</a></li> <li> <a class="s footIco facebook" href="http://www.facebook.com/ScirraOfficial" target="_blank" title="Visit Scirra on Facebook"></a> <a class="s footIco twitter" href="http://twitter.com/Scirra" target="_blank" title="Follow Scirra on Twitter"></a> <a class="s footIco youtube" href="http://www.youtube.com/user/ScirraVideos" target="_blank" title="Visit Scirra on Youtube"></a> </li> </ul> </div> <div class="footerItem"> <h4>About Us</h4> <ul> <li><a href="#">Contact Information</a></li> <li><a href="#">Advertising</a></li> <li><a href="#">History</a></li> <li><a href="#">Privacy Policy</a></li> <li><a href="#">Terms and Conditions</a></li> </ul> </div> <div class="footerItem"> <h4>Want to Help?</h4> <p>You can contribute to the community <a href="#">in lots of ways</a>. We have a large active friendly community, and there are lots of ways to join in!</p> <a href="#" class="ralign"><strong>Learn More</strong></a> </div> <div class="clear"></div> </div> </div> <div class="copyright"> Copyright &copy; 2011 Scirra.com. All rights reserved. </div> </footer> <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.4/jquery.min.js"></script> <script type="text/javascript" src="js/common.js"></script> <script type="text/javascript" src="plugins/coin-slider/coin-slider.min.js"></script> <script type="text/javascript" src="js/homepage.js"></script> </body> </html>

    Read the article

  • Displaying and updating score in Android (OpenGL ES 2)

    - by user16547
    I'm using a FrameLayout where I have a GLSurfaceView at the bottom and a few Views on top of it. One of those Views is a TextView that displays the current score. Here's how I'm updating the score TextView based on what happens in my game loop: whenever an event happens that increases the score, I call activity.runOnUiThread(updater), where activity is the activity that has the above FrameLayout (my main game activity) and updater is just a Runnable that increments the score. From my understanding, using runOnUiThread() from the OpenGL thread is standard practice - otherwise you'll get an exception, I can't remember its name. The problem is that there's a very noticeable lag between the event and the score update. For example the character gets a coin, but the coin count is not updated quickly. I tried summing all the score events from my game loop and calling runOnUiThread() only once per loop, but it doesn't seem to make much of a difference - the lag is still noticeable. How can I improve my design to avoid this lag?

    Read the article

  • Any ccTalk libraries available?

    - by fretje
    I want to integrate a coin acceptor into one of our applications. This specific coin acceptor uses the ccTalk protocol (specs here). I've been looking for a ccTalk library which I can use from C#, but until this point I've only found this open source project which seems not quite ready, and abandoned. Any of you guys know of any ccTalk libraries out there? I can't believe this hasn't been done before. It doesn't necessarily has to be free.

    Read the article

  • Less than in Groovy case/switch statement

    - by UltraVi01
    I have the following switch statement switch (points) { case 0: name = "new"; break; case 1..14: badgeName = "bronze-coin"; break; case 15..29: badgeName = "silver-coin"; break; default: badgeName = "ruby"; } I'd like the first case (case 0) to include points less than or equal to 0. How can I do this in Groovy?

    Read the article

  • Should I make the Cells in a Tiledmap as null when my player hits it

    - by Vishal Kumar
    I am making a Tile Based game using Libgdx. I took the idea from SuperKoalio platformer demo by Mario Zencher. When I wanted to implement Collectables in my game , I simply draw the coins using Tiled Map Editor. When my player hits that, I use to set that cell as null. Someday on this site suggested me not to do so... never use null. I agreed. What can be any other way. If I am using layer.setCell(x,y) to set the cell to any other cell... even if an transparent one .. my player seems to be stopped by an invisible object/hurdle. This is my code: for (Rectangle tile : tiles) { if (koalaRect.overlaps(tile)) { TiledMapTileLayer layer = (TiledMapTileLayer) map.getLayers().get(1); try{ type = layer.getCell((int) tile.x, (int) tile.y).getTile().getProperties().get("tileType").toString(); } catch(Exception e){ System.out.print("Exception in Tiles Property"+e); type="nonbreakable"; } //Let us destroy this cell if(("award".equals(type))){ layer.setCell((int) tile.x, (int) tile.y, null); listener.coin(); score+=100; test = ""+layer.getCell(0, 0).getTile().getProperties().get("tileType"); } //DOING THIS GIVES A BAD EFFECT if(("killer".equals(type))){ //player.health--; //layer.setCell((int) tile.x, (int) tile.y, layer.getCell(20,0)); } // we actually reset the player y-position here // so it is just below/above the tile we collided with // this removes bouncing :) if (player.velocity.y > 0) { player.position.y = (tile.y - Player.height); } Is this a right approach? OR I should create separate Sprite Class called Coin.

    Read the article

  • ???????????Java SE 7??????! ?Java SE 7 ?????? ?????? ???!

    - by rika.tokumichi
    2006?Java SE6???????5????????????????????Java SE 7???????????????????????????????????????????2011?7?7???Java SE 7 ?????? ?????????????? ???????????????????????Java SE 7????????????????????????????????????????????Java????????????????1??????????????????? ????????????????????????????????? ?????????????Java SE 7????????Java SE8?????????????????????Java??????????????????HotSpot???JRockit??????Java???????????????????????????? ?????????????Java SE 7???????????Project Coin??InvokeDynamic??NIO.2??JSR-166y????????????????????????????????????? ????????????????????????????????????????????????????????????????????????????????? ???????????? Java SE 7 ??????????????????????????????Tips??????????????Java SE7????????????????????????????????????????????????? ??????????????????????Ustream?????????????????????! ???? Java SE 7 ?????? ?????? ??:2011?7?7?14?~ ??:?????????? 13F S3?S4 ?????(??) (????) 14:00 - 14:20????? 14:20 - 15:10Java SE 7?8??? 15:15 - 16:05HotRockit?Java?????????? 16:05 - 16:20?? (????) 16:20 - 17:05NetBeans 7.0?Project Coin??? 17:05 - 17:50InvokeDynamic??? 17:50 - 18:05?? 18:05 - 18:35NIO.2??? 18:35 - 19:05JSR 166y??? 19:05 -??? * ????????????????????????? ??????????????? ????????????

    Read the article

  • ???????????Java SE 7??????! ?Java SE 7 ?????? ?????? ???!

    - by rika.tokumichi
    2006?Java SE6???????5????????????????????Java SE 7???????????????????????????????????????????2011?7?7???Java SE 7 ?????? ?????????????? ???????????????????????Java SE 7????????????????????????????????????????????Java????????????????1??????????????????? ????????????????????????????????? ?????????????Java SE 7????????Java SE8?????????????????????Java??????????????????HotSpot???JRockit??????Java???????????????????????????? ?????????????Java SE 7???????????Project Coin??InvokeDynamic??NIO.2??JSR-166y????????????????????????????????????? ????????????????????????????????????????????????????????????????????????????????? ???????????? Java SE 7 ??????????????????????????????Tips??????????????Java SE7????????????????????????????????????????????????? ??????????????????????Ustream?????????????????????! ???? Java SE 7 ?????? ?????? ??:2011?7?7?14?~ ??:?????????? 13F S3?S4 ?????(??) (????) 14:00 - 14:20????? 14:20 - 15:10Java SE 7?8??? 15:15 - 16:05HotRockit?Java?????????? 16:05 - 16:20?? (????) 16:20 - 17:05NetBeans 7.0?Project Coin??? 17:05 - 17:50InvokeDynamic??? 17:50 - 18:05?? 18:05 - 18:35NIO.2??? 18:35 - 19:05JSR 166y??? 19:05 -??? * ????????????????????????? ??????????????? ????????????

    Read the article

  • Information Gain and Entropy

    - by dhorn
    I recently read this question regarding information gain and entropy. I think I have a semi-decent grasp on the main idea, but I'm curious as what to do with situations such as follows: If we have a bag of 7 coins, 1 of which is heavier than the others, and 1 of which is lighter than the others, and we know the heavier coin + the lighter coin is the same as 2 normal coins, what is the information gain associated with picking two random coins and weighing them against each other? Our goal here is to identify the two odd coins. I've been thinking this problem over for a while, and can't frame it correctly in a decision tree, or any other way for that matter. Any help? EDIT: I understand the formula for entropy and the formula for information gain. What I don't understand is how to frame this problem in a decision tree format. EDIT 2: Here is where I'm at so far: Assuming we pick two coins and they both end up weighing the same, we can assume our new chances of picking H+L come out to 1/5 * 1/4 = 1/20 , easy enough. Assuming we pick two coins and the left side is heavier. There are three different cases where this can occur: HM: Which gives us 1/2 chance of picking H and a 1/4 chance of picking L: 1/8 HL: 1/2 chance of picking high, 1/1 chance of picking low: 1/1 ML: 1/2 chance of picking low, 1/4 chance of picking high: 1/8 However, the odds of us picking HM are 1/7 * 5/6 which is 5/42 The odds of us picking HL are 1/7 * 1/6 which is 1/42 And the odds of us picking ML are 1/7 * 5/6 which is 5/42 If we weight the overall probabilities with these odds, we are given: (1/8) * (5/42) + (1/1) * (1/42) + (1/8) * (5/42) = 3/56. The same holds true for option B. option A = 3/56 option B = 3/56 option C = 1/20 However, option C should be weighted heavier because there is a 5/7 * 4/6 chance to pick two mediums. So I'm assuming from here I weight THOSE odds. I am pretty sure I've messed up somewhere along the way, but I think I'm on the right path! EDIT 3: More stuff. Assuming the scale is unbalanced, the odds are (10/11) that only one of the coins is the H or L coin, and (1/11) that both coins are H/L Therefore we can conclude: (10 / 11) * (1/2 * 1/5) and (1 / 11) * (1/2) EDIT 4: Going to go ahead and say that it is a total 4/42 increase.

    Read the article

< Previous Page | 1 2 3 4 5  | Next Page >