<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:dc="http://purl.org/dc/elements/1.1/" version="2.0"><channel><atom:link rel="hub" href="http://tumblr.superfeedr.com/" xmlns:atom="http://www.w3.org/2005/Atom"/><description>Hey I’m Brandon. This is the place where I contribute my knowledge to the programming community as well as my many ideas. Hope you find it helpful!</description><title>coding at midnight</title><generator>Tumblr (3.0; @codingatmidnight)</generator><link>http://codingatmidnight.tumblr.com/</link><item><title>Encoding/Decoding the Game Score</title><description>&lt;p&gt;So earlier I came up with an idea for saving high scores in my game. With my previous game, the high scores, data, etc. would be saved directly into a text file, making it far too accessible. I had a ton of problems with cheaters modifying the high scores within the file. My idea for this next game is to encode the high score and data into something that only the game would know how to decode. So it&amp;#8217;s like this: Imagine the high score is..3,000.&lt;/p&gt;
&lt;p&gt;Highscore = 3000 // unencoded&lt;/p&gt;
&lt;p&gt;Highscore = ((3000 - 20) * 1.65) + 829 // encoded to 5,746&lt;/p&gt;
&lt;p&gt;So you see the &amp;#8220;Highscore&amp;#8221; is mathematically encoded/decoded and only the game knows the values to decode it. The value of the highscore   encoded  = 5746. This is not the actual value of the score but the game can figure it out by doing the encode math in reverse.&lt;/p&gt;
&lt;p&gt;Highscore = ((5746 - 829) / 1.65) + 20 // decoded back to 3,000&lt;/p&gt;
&lt;p&gt;As long as you do not know the mathematical values used to encode/decode the highscore, I think it&amp;#8217;s almost impossible to hack the game highscore.&lt;/p&gt;
&lt;p&gt;Just my idea ;D let me know what you think.&lt;/p&gt;</description><link>http://codingatmidnight.tumblr.com/post/3557253978</link><guid>http://codingatmidnight.tumblr.com/post/3557253978</guid><pubDate>Sun, 27 Feb 2011 22:23:34 -0500</pubDate></item><item><title>Photo</title><description>&lt;img src="http://25.media.tumblr.com/tumblr_lh5g0seSCm1qh684io1_500.png"/&gt;&lt;br/&gt;&lt;br/&gt;</description><link>http://codingatmidnight.tumblr.com/post/3493381308</link><guid>http://codingatmidnight.tumblr.com/post/3493381308</guid><pubDate>Thu, 24 Feb 2011 20:26:52 -0500</pubDate></item><item><title>Thought I'd share this...</title><description>&lt;p&gt;Found &lt;a title="this article" target="_blank" href="http://www.codza.com/how-to-debug-exc_bad_access-on-iphone"&gt;this article&lt;/a&gt; extremely useful when I was fixing memory errors in my iPhone game.&lt;/p&gt;</description><link>http://codingatmidnight.tumblr.com/post/3492851646</link><guid>http://codingatmidnight.tumblr.com/post/3492851646</guid><pubDate>Thu, 24 Feb 2011 19:58:35 -0500</pubDate></item><item><title>*Coming soon*</title><description>&lt;img src="http://24.media.tumblr.com/tumblr_lgw9orrEvG1qh684io1_500.png"/&gt;&lt;br/&gt;&lt;br/&gt;&lt;p&gt;*Coming soon*&lt;/p&gt;</description><link>http://codingatmidnight.tumblr.com/post/3393871472</link><guid>http://codingatmidnight.tumblr.com/post/3393871472</guid><pubDate>Sat, 19 Feb 2011 21:31:39 -0500</pubDate></item><item><title>I hear a lot about programmers not being creative enough to create their own video game art. I used...</title><description>&lt;p&gt;I hear a lot about programmers not being creative enough to create their own video game art. I used to be in the same boat when I first started out developing games but honestly now I think it&amp;#8217;s a load of bull crap. I say if you get frustrated with your art skills just keep at it until you get the hang of it. Also when you find a tool to create your art, stick with it. Spend some time familiarizing yourself with it and when you feel like you know your tool extremely well then everything will seem so simple. I also took a drawing class which really helped bring out that creative side.&lt;/p&gt;
&lt;p&gt;Just my advice. ;D&lt;/p&gt;</description><link>http://codingatmidnight.tumblr.com/post/3356220640</link><guid>http://codingatmidnight.tumblr.com/post/3356220640</guid><pubDate>Thu, 17 Feb 2011 22:21:22 -0500</pubDate></item><item><title>WHERE WOULD YOU MOST LIKE TO VISIT ON YOUR PLANET?</title><description>&lt;p&gt;Mars&lt;/p&gt;
&lt;p&gt;Wait..on my planet? probably burger king.&lt;/p&gt;</description><link>http://codingatmidnight.tumblr.com/post/3253116423</link><guid>http://codingatmidnight.tumblr.com/post/3253116423</guid><pubDate>Sat, 12 Feb 2011 11:16:00 -0500</pubDate></item><item><title>Cocos2D iPhone: Set a maximum width for labels</title><description>&lt;p&gt;Often I find myself placing labels in certain points on of the screen where there isn&amp;#8217;t much space. The problem with not having much space is for example when you have a label that displays your current game score. If your game score gets very large like &amp;#8220;1,002,349,&amp;#8221; then the label might begin overlapping other elements in your game such as the HUD (heads-up-display). So here is my solution to the problem:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;    float maximumLabelWidth = 192; //the maximum width (in pixels) that the label can reach. Set this to whatever works for you.&lt;/p&gt;
&lt;p&gt;    if (scoreLabel.contentSize.width &amp;gt; maximumLabelWidth)&lt;br/&gt;    scoreLabel.scale = maximumLabelWidth / scoreLabel.contentSize.width;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Of course, &amp;#8220;scoreLabel&amp;#8221; is a CCBitmapFontAtlas FYI. Simple enough right? Using this method, the label will shrink itself so that the width never exceeds the maximumLabelWidth variable.&lt;/p&gt;</description><link>http://codingatmidnight.tumblr.com/post/3247149297</link><guid>http://codingatmidnight.tumblr.com/post/3247149297</guid><pubDate>Sat, 12 Feb 2011 00:49:17 -0500</pubDate></item></channel></rss>
