tag:blogger.com,1999:blog-72730392830460317792024-02-12T21:31:38.197+05:30life of a Gadget GeekMy experiences as i live the life of a gadget geek.Unknownnoreply@blogger.comBlogger110125tag:blogger.com,1999:blog-7273039283046031779.post-77015265772597032952016-03-10T19:27:00.000+05:302016-03-11T00:05:56.669+05:30The tricks to a good HTML5 game - Part 3 - Touch events and Modular code<span style="font-family: "arial" , "helvetica" , sans-serif;"> Making an HTML5 game , Like any other programming project, comes with it's own peculiarities .As I worked on <a href="https://play.google.com/store/apps/details?id=com.dracon.spacezombies">Space Zombies</a> ,I noticed the seemingly "easy" way of doing things is actually less productive and at times can even reduce performance.</span><br>
<h2>
<span style="font-weight: normal;"><span style="font-size: small;"><br></span></span><span style="font-family: Arial, Helvetica, sans-serif; font-weight: normal;"><span style="font-size: small;"><br></span><span style="font-size: small;">This is part 3 in a series of posts , read the <a href="http://gadget-geek-prashant.blogspot.in/2015/12/the-tricks-to-good-html5-game-part-1.html">first part about animations and game loop here.</a>and the <a href="http://gadget-geek-prashant.blogspot.in/2015/12/the-tricks-to-good-html5-game-part-2.html#.VuFsd9x97Qo">second part about canvas redraws and clearing here</a> .<br></span></span><br>
</h2><a href="https://gadget-geek-prashant.blogspot.com/2016/03/the-tricks-to-good-html5-game-part-3.html#more">Click here to read full post »</a>Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-7273039283046031779.post-46894440275821197422016-01-03T14:24:00.002+05:302016-01-04T04:05:48.988+05:30Fixing Microsoft Wireless Mouse 1000 jerky scroll issue - Video<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg_U3vM-3NbdUIV3yjT7i5kdWslKgHidKt6ejw3FOxllkAOiEcqT28LSV_m3IOWuANnW-TI4qkVnkKJvXZu5WOxBf8v4tj9ilQyE2RiF0KeFaMORZvH72aQ96YTro5UjsERimhmSb5VmAI/s1600/mk_wd800_otherviews01.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="176" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg_U3vM-3NbdUIV3yjT7i5kdWslKgHidKt6ejw3FOxllkAOiEcqT28LSV_m3IOWuANnW-TI4qkVnkKJvXZu5WOxBf8v4tj9ilQyE2RiF0KeFaMORZvH72aQ96YTro5UjsERimhmSb5VmAI/s320/mk_wd800_otherviews01.jpg" width="320"></a></div>
<br>
<br>
<div>
A few months back I got this awesome pair of wireless keyboard and mouse from Microsoft, Yes you do need a dongle in one of the USB ports but it makes them so much easier to set up and use !<br>
<div>
recently i had to change the batteries in my mouse for the first time, and after that i noticed that the scroll wheel was acting up , when ever i would scroll the motion would be jerky and some times it would jump back in the opposite direction .<br>
<br>
</div></div><a href="https://gadget-geek-prashant.blogspot.com/2016/01/fixing-microsoft-wireless-mouse-1000.html#more">Click here to read full post »</a>Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-7273039283046031779.post-29113786903155782192015-12-30T22:50:00.000+05:302016-03-10T13:14:06.464+05:30The tricks to a good HTML5 game - Part 2 - Clearing and Redrawing<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg9UwhPRP5JOjzOkC8v7Vfq83y2YkDobcOf0Y7B-fy0ytC0ASGRyE9fcle_qOoIij3IIvOIwFTwGahz9NfM5AMmx9ybuVymKq83i4Avxt9IFb5XcbcHksSOqyz5gDvSiZIOuwrS7nVe3DA/s1600/Screenshot_2015-12-30-22-17-29.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" height="225" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg9UwhPRP5JOjzOkC8v7Vfq83y2YkDobcOf0Y7B-fy0ytC0ASGRyE9fcle_qOoIij3IIvOIwFTwGahz9NfM5AMmx9ybuVymKq83i4Avxt9IFb5XcbcHksSOqyz5gDvSiZIOuwrS7nVe3DA/s400/Screenshot_2015-12-30-22-17-29.png" width="400"></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Space Zombies v1.8.0 </td></tr>
</tbody></table>
Making an HTML5 game has its own quirks, there are things that work , and things that seem like they should work sometimes just don't work.As I worked on <a href="https://play.google.com/store/apps/details?id=com.dracon.spacezombies" target="_blank">Space Zombies</a> ,I experienced this first hand, there were times i was frustrated after looking for days for a solution to some of the issues i faced. If you plan on making an HTML5 game and this is your first time , this series of posts will surely be of use to you.<br>
<br>
Note: This is part 2 in a series of posts , read the <a href="http://gadget-geek-prashant.blogspot.in/2015/12/the-tricks-to-good-html5-game-part-1.html" target="_blank">first part about animations and game loop here.</a>.<br>
<br>
<br>
<a href="https://gadget-geek-prashant.blogspot.com/2015/12/the-tricks-to-good-html5-game-part-2.html#more">Click here to read full post »</a>Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-7273039283046031779.post-17172254001202472422015-12-25T18:09:00.001+05:302016-03-10T13:13:38.277+05:30The tricks to a good HTML5 game - Part 1 - Animation and game loop Making a game in HTML 5 without using a game engine is perhaps not the easiest way to do things, but it definitely makes it much more of a learning experience.This series contains few of the things that I had to learn the hard way in the process of making my <a href="https://play.google.com/store/apps/details?id=com.dracon.spacezombies&hl=en" target="_blank">Space Zombies game</a> .<br />
<div class="separator" style="clear: both; text-align: center;">
</div>
<br />
<br />
This post is about getting fluid animations and proper game loop execution.<br />
<h2>
Always use requestAnimationFrame for animating </h2>
<div>
<br /></div>
In a game, one of the most important things are the visuals and the animations , and requestAnimationFrame makes it not only easy to implement and manage but keeps your HTML5 game efficient.<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjRMFu-oDEBbZ212FO-9VKt4cerAsU_E2Z-TZfTferJPvwuO8jNFYuwXl5UYNX_WRViZabqbrzDcl1UExUD4h0SzhzM6zpWYN8TQAM1zES34Oq0YBXtWoUKOixtdpFK3EQo8JDuphWEfvw/s1600/figure2.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="121" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjRMFu-oDEBbZ212FO-9VKt4cerAsU_E2Z-TZfTferJPvwuO8jNFYuwXl5UYNX_WRViZabqbrzDcl1UExUD4h0SzhzM6zpWYN8TQAM1zES34Oq0YBXtWoUKOixtdpFK3EQo8JDuphWEfvw/s320/figure2.png" width="320" /></a></div>
<br />
Earlier method of animating would be to use setInterval for redrawing animations after x milliseconds , but the display would refresh at its own set rate, typically 60Hz , leading to unnecessary redrawing, which the user would not even see, as shown in the above image.<br />
<br />
With raf the browser will automatically <i>try</i> to ensure you have a refresh rate equivalent to the monitor refresh rate, typically you should get close to 60fps , but that depends on multiple factors.But it will certainly reduce if not eliminate the unnecessary redraws.What's most important is that this method of animating makes your animations battery and CPU friendly, while also giving you performance improvements. The usage is pretty straight forward too.<br />
<blockquote class="tr_bq">
function render() {<br />
requestAnimationFrame(render);<br />
//your rendering code<br />
}<br />
render();</blockquote>
you can read more about raf and why it's better <a href="https://dev.opera.com/articles/better-performance-with-requestanimationframe/" target="_blank">here</a> , and for a polyfill <a href="http://www.paulirish.com/2011/requestanimationframe-for-smart-animating/" target="_blank">visit here</a>.<br />
<br />
<h2>
Use requestAnimationFrame <i>only</i> for rendering</h2>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgt34ZdUYoKIgWYDkee0vNjHd7VOENZOWV9yWNHkiP6QowBDnItOfz0y7kTs6Tk7J6KiZlqszqtcqcekn-_FreqD-6dLmc6lVFeunjFL3BknYVLXIY9sJhU6gvEHkxbZK35sAJ790Kz9z4/s1600/dc68ac34-166e-49d2-8267-0a76fcbcccb2.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="180" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgt34ZdUYoKIgWYDkee0vNjHd7VOENZOWV9yWNHkiP6QowBDnItOfz0y7kTs6Tk7J6KiZlqszqtcqcekn-_FreqD-6dLmc6lVFeunjFL3BknYVLXIY9sJhU6gvEHkxbZK35sAJ790Kz9z4/s320/dc68ac34-166e-49d2-8267-0a76fcbcccb2.jpg" width="320" /></a></div>
<div>
<br /></div>
<div>
<br /></div>
<div>
One easy to make mistake while using raf is to put all your update code and your rendering code in the same function that you are using with requestAnimationFrame , while this seems like a nice idea for repeatedly running your game logic , it's a bad idea for multiple reasons ,<br />
<ul>
<li>Based on device resources, raf will have varying delays between subsequent calls to your function.Putting all your update logic here will mean that the game will run at unpredictable speeds,with speeds varying not just between devices, but even among different runs on the same device.For good user experience, you want there to be consistency in how fast your game runs.</li>
<li>Putting all your update logic in a function that you expect to be called every ~20ms , will usually mean that, you'll have a longer execution time for the function itself, leading to frame drops and choppy graphics.</li>
<li>Using raf only for rendering, will allow you to update the game at an almost constant rate using JavaScript timing functions, which you can control.<br /><i><b>Basically you get better control over your update speed.</b></i></li>
</ul>
<div>
<div class="separator" style="clear: both; text-align: center;">
</div>
See the above <a href="http://towers.netai.net/HTML5demos/raf_update.html" target="_blank">demo here</a> ,in the demo the raf is running at a maximum of 60 updates per second , but the setInterval can be controlled to run at even 100 updates per second, leading to faster updates,the difference is much more easily seen on a mobile device,where sometimes the raf update rate goes well below 40 updates per second.<br />
<br />
So we've seen how to get a consistent game loop and an efficient redraw method.In the <a href="http://gadget-geek-prashant.blogspot.in/2015/12/the-tricks-to-good-html5-game-part-2.html#.Voml23V97Qo" target="_blank">next part , we will deal with improving the frame rate of your game</a>. In the mean time, i would appreciate it , if you tried and rated my game <a href="https://play.google.com/store/apps/details?id=com.dracon.spacezombies&hl=en" target="_blank">Space Zombies on google play</a><br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhmZKapi1Ivep2NQ93mVn4fXzXQlAbcxLMISohVbX_NFTYTIjHze0wJMfWZl7qBQcJzUGx1jGpJzV-F-qAmHOb18hBGOMyvV2ab9xU4oot6_5v3KsR4Auv4TlYDhsLRjCcJJ6zQbEiRtEI/s1600/feature.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="156" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhmZKapi1Ivep2NQ93mVn4fXzXQlAbcxLMISohVbX_NFTYTIjHze0wJMfWZl7qBQcJzUGx1jGpJzV-F-qAmHOb18hBGOMyvV2ab9xU4oot6_5v3KsR4Auv4TlYDhsLRjCcJJ6zQbEiRtEI/s320/feature.png" width="320" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
Looking for a way to monetize your android or Ios app ? I've been using<a href="https://portal.startapp.com/#/signup?referredBy=f7ead8ce-8d2d-3580-ecdd-19a74b524f39" target="_blank"> Startapp</a> , and its fairly easy to integrate and they have bonus cash to earn based on your current earning , they support multiple platforms , from HTML5 to JAVA application to Unity , give them a shot !</div>
<br /></div>
</div>
Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-7273039283046031779.post-17628722821023095922015-10-10T21:18:00.003+05:302015-10-10T21:18:16.731+05:30Install OpenCV on Ubuntu for computer vision fun This is a guide i'm putting together for a friend , on setting up OpenCv for use in python on Ubuntu. Now , i'm sure there are other ways to do this , but this is the way i followed , and it worked for me .<br>
<div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhekjK6hnGDY04sqAP37KHjox9p-9aYgoR5apkgYrH0M1Ivm6IemHSpjf6vZy5QA0OtZ1bafCYRLFrneJxHOLR9KDRTyvuLxl-_1GBmWHUeyvlR5b_K-McFq6RLVRPFr43Wx6SnOPN-upY/s1600/opencv-python.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="195" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhekjK6hnGDY04sqAP37KHjox9p-9aYgoR5apkgYrH0M1Ivm6IemHSpjf6vZy5QA0OtZ1bafCYRLFrneJxHOLR9KDRTyvuLxl-_1GBmWHUeyvlR5b_K-McFq6RLVRPFr43Wx6SnOPN-upY/s320/opencv-python.png" width="320"></a></div><div class="separator" style="clear: both; text-align: center;"></div><a href="https://gadget-geek-prashant.blogspot.com/2015/10/install-opencv-on-ubuntu-for-computer.html#more">Click here to read full post »</a>Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-7273039283046031779.post-31075391990927994312015-09-17T15:22:00.001+05:302015-09-17T15:28:17.891+05:30Blokky - A color matching gameA while back i read up on data structures like stacks , queues and graphs and wanted to try them out as a mini project , in 7-8 hours spanning over 2 days , I had made <a href="http://towers.netai.net/blokky/index.html" target="_blank">Blokky</a> .<br>
<br>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEguQTU-DTU41Kp57s9bJGrR8uQkRyuZ7OHcsfRc4-LA442fHnmeOPl08xQBfZAvHOKLxKL70m37DxzLhCNO9iFNOzKEl8Cd84x1PbSTJ4lqJCAQDO7zVDKyOYAksQ4A56r8qtM41x5KDxw/s1600/Screenshot+from+2015-09-16+21%253A56%253A29.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="230" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEguQTU-DTU41Kp57s9bJGrR8uQkRyuZ7OHcsfRc4-LA442fHnmeOPl08xQBfZAvHOKLxKL70m37DxzLhCNO9iFNOzKEl8Cd84x1PbSTJ4lqJCAQDO7zVDKyOYAksQ4A56r8qtM41x5KDxw/s320/Screenshot+from+2015-09-16+21%253A56%253A29.png" width="320"></a></div>
<br>
<br>
It's a simple game with simple mechanics , you click the group of a color and the group vanishes , the level ends when u have no valid moves left , if the number of blokky(the color blocks) left after u have no moves left is smaller than the level you're on , then u are allowed to progress to the next level.Each level adds another color to the palette , so the game gets progressively more challenging however there is the ability to undo your moves at the cost of <i>half your current score ,</i> redo is free though.<br>
<br>
<a href="https://gadget-geek-prashant.blogspot.com/2015/09/blokky-color-matching-game.html#more">Click here to read full post »</a>Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-7273039283046031779.post-5473361604971780752015-07-19T10:25:00.001+05:302015-07-22T20:40:56.827+05:30Making a Python game - Start and end screens - Part 4Last time in this series, we got the game to the point ,<a href="http://gadget-geek-prashant.blogspot.com/2015/07/making-python-game-obstacles-part-3.html" target="_blank"> where it seems like it is finally playable</a>.But as the game's programmer some things are obvious to to you and me that wouldn't be that obvious to someone else , they might even have no idea what to do !<br />
<div>
so we shall add a start screen , with instructions on how to play.<br />
<div>
<div>
we also saw that the game quits too quickly after the player hits the obstacle , we don't even get to final score !,</div>
<div>
so, we shall add an end screen to display this final score as well as the current game speed.</div>
</div>
</div>
<div>
<br /></div>
<div>
Let's begin by adding some constants and variables to store our game's instructions and states <br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhQIaWuX-2m4hzpmLAaga9DoeP2W3Pxc6D35MurGIA_0hEtcFO6qPInpprIbk2QptLbmIu7j8hWwOUu2vw7UK-u-GxBRpJ73EQyuNSjgyZ5eEC6CXmAMxM8DT2h1JlwHBx40qwpMUpHcY4/s1600/Screenshot+from+2015-07-19+01%253A41%253A33.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="108" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhQIaWuX-2m4hzpmLAaga9DoeP2W3Pxc6D35MurGIA_0hEtcFO6qPInpprIbk2QptLbmIu7j8hWwOUu2vw7UK-u-GxBRpJ73EQyuNSjgyZ5eEC6CXmAMxM8DT2h1JlwHBx40qwpMUpHcY4/s400/Screenshot+from+2015-07-19+01%253A41%253A33.png" width="400" /></a></div>
<div class="separator" style="clear: both; text-align: left;">
The constant "STARTSCREEN_TEXT" stores the entire instructions you want to display on the startscreen , divided in multiple pages and lines, ready to be displayed on the screen.</div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjEvm5NSFkIpPpX7PhepfX_5SY390_XfjU4oNP3dKaVl5CanGgi8AE3xKtL9YjpPem6J3B87hyu_jtAAN6_Yzhb3mSIw6_ZS5r0jIM7ffg8hH27lPZjvEW__uJ2qqpsRSFXFOdPRsJuZqk/s1600/Screenshot+from+2015-07-19+01%253A41%253A47.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="126" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjEvm5NSFkIpPpX7PhepfX_5SY390_XfjU4oNP3dKaVl5CanGgi8AE3xKtL9YjpPem6J3B87hyu_jtAAN6_Yzhb3mSIw6_ZS5r0jIM7ffg8hH27lPZjvEW__uJ2qqpsRSFXFOdPRsJuZqk/s400/Screenshot+from+2015-07-19+01%253A41%253A47.png" width="400" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
</div>
The variable "startstate" stores the page number on the start screen.<br />
<br />
Next, we will add the startscreen and endscreen functions to the game.<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEijhAGbP1SrpWbHrQQ3BxmgKuhlFPNR5TEufYMoWQcjHxdah8q9Cx9JNDHXbK0qFutWq6iSkn7SLVfHBfK-oww_sREh7R4EwxE2B03L7KUL-6jWMPcWU5q7TOtvM7HaRVQjyaO5nKpI1mw/s1600/Screenshot+from+2015-07-19+09%253A59%253A37.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="400" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEijhAGbP1SrpWbHrQQ3BxmgKuhlFPNR5TEufYMoWQcjHxdah8q9Cx9JNDHXbK0qFutWq6iSkn7SLVfHBfK-oww_sREh7R4EwxE2B03L7KUL-6jWMPcWU5q7TOtvM7HaRVQjyaO5nKpI1mw/s640/Screenshot+from+2015-07-19+09%253A59%253A37.png" width="640" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
startscreen displays the first page of the "STARTSCREEN_TEXT" and waits for a key press , if "space" is pressed then it moves to the next page , else if "esc" is pressed it skips the start screen and directly enters the game</div>
<br />
endscreen simply shows the score and the game speed and waits for the player to press "esc" , on doing so it will quit the game.<br />
<br />
now that our functions have been defined , we will integrate them in our game.<br />
we need to show the start screen , before our game loop and the endscreen after our game loop, so we call these functions in these respective positions.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgiay3YpaXAZhOAgVqz60VP6kQrY3Xgu-xwrw4Wieo71sCBvct6gmD7FMXa9zwrGnt4LuNbqwMxf8tVnhqm5Vhw0VpmofbgGvNEU6q00vZlsTt-4_qdzn5rJLbN2ZI8EGEsz1ZRmCWXKIU/s1600/Screenshot+from+2015-07-19+10%253A06%253A47.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgiay3YpaXAZhOAgVqz60VP6kQrY3Xgu-xwrw4Wieo71sCBvct6gmD7FMXa9zwrGnt4LuNbqwMxf8tVnhqm5Vhw0VpmofbgGvNEU6q00vZlsTt-4_qdzn5rJLbN2ZI8EGEsz1ZRmCWXKIU/s1600/Screenshot+from+2015-07-19+10%253A06%253A47.png" /></a></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg4FFivIfOB19s811ErJmcgu81OkniiQxu3AQcmpha5fiq8_6LkqNa3rFY_rmYtcTD2xuRzMGLGVzTAuYxXid8A1bTrW2hzKE1dSWQXI0H5QTq_Neib5bYhvIs5TDsf4GX2CIguRQJ5oaA/s1600/Screenshot+from+2015-07-19+10%253A06%253A52.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg4FFivIfOB19s811ErJmcgu81OkniiQxu3AQcmpha5fiq8_6LkqNa3rFY_rmYtcTD2xuRzMGLGVzTAuYxXid8A1bTrW2hzKE1dSWQXI0H5QTq_Neib5bYhvIs5TDsf4GX2CIguRQJ5oaA/s1600/Screenshot+from+2015-07-19+10%253A06%253A52.png" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
</div>
<br />
<div class="separator" style="clear: both; text-align: center;">
</div>
<div class="separator" style="clear: both; text-align: left;">
now , try running the game , you will see something like this ,</div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjlP0yVjHwRK7fJBWMu8FsPTqIYJMOo5vp-ru9vCf2bNZjugO6PkdDUX9TUjJ8pFCLAypBeTg27jIKtCAIpVANiwypHHPkdZqWOxMZGcBmTk6g3HOBEDETqq_t7AP26f2Sw4oe8CpgnXQo/s1600/Screenshot+from+2015-07-19+10%253A13%253A55.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="131" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjlP0yVjHwRK7fJBWMu8FsPTqIYJMOo5vp-ru9vCf2bNZjugO6PkdDUX9TUjJ8pFCLAypBeTg27jIKtCAIpVANiwypHHPkdZqWOxMZGcBmTk6g3HOBEDETqq_t7AP26f2Sw4oe8CpgnXQo/s320/Screenshot+from+2015-07-19+10%253A13%253A55.png" width="320" /></a></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiIt-56aPUi7k8EkJT6c0W7VfR1mD98mkZo0VqAuKNe8V1sMJXpbWHxwxMbu9M6uafJrDccKuY1jhamqBtZOeyGl7GYL14K3U_4FGy8IZZYoyei3CTedK9vDMesH5dyvfxZ20FhQbH0pI8/s1600/Screenshot+from+2015-07-19+10%253A14%253A03.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="142" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiIt-56aPUi7k8EkJT6c0W7VfR1mD98mkZo0VqAuKNe8V1sMJXpbWHxwxMbu9M6uafJrDccKuY1jhamqBtZOeyGl7GYL14K3U_4FGy8IZZYoyei3CTedK9vDMesH5dyvfxZ20FhQbH0pI8/s320/Screenshot+from+2015-07-19+10%253A14%253A03.png" width="320" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
The startscreen.</div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh5PSaJwD8KfLjsH9vVFC6oPHdPg1QCF6ZDJc8oUvwOfHgsEq40WmRqQA-ZnB38pFzKaBt1xXxLP__3c2jOqKhB7-LA1A0E7Wmnp-29rzHzOg_e81pZJ0AQ4fWaogH-6c9ddKkyyfcRnJk/s1600/Screenshot+from+2015-07-14+23%253A12%253A25.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="120" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh5PSaJwD8KfLjsH9vVFC6oPHdPg1QCF6ZDJc8oUvwOfHgsEq40WmRqQA-ZnB38pFzKaBt1xXxLP__3c2jOqKhB7-LA1A0E7Wmnp-29rzHzOg_e81pZJ0AQ4fWaogH-6c9ddKkyyfcRnJk/s320/Screenshot+from+2015-07-14+23%253A12%253A25.png" width="320" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
The game play , is exactly like the last version</div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj4E_Wf9sZUAKhVT6EfbR9Qpr_OSjuCXinvn6lqMWtF274AD3KKk_7lyO3fMOSGQDf7Ia8-AL8YC9ZDNcNPm3miBxf8p6MzrEtkrUgn-a27voiloQVIXMg8cKiH1K_Q3T8nYznA_lni7vQ/s1600/Screenshot+from+2015-07-19+10%253A13%253A43.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="136" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj4E_Wf9sZUAKhVT6EfbR9Qpr_OSjuCXinvn6lqMWtF274AD3KKk_7lyO3fMOSGQDf7Ia8-AL8YC9ZDNcNPm3miBxf8p6MzrEtkrUgn-a27voiloQVIXMg8cKiH1K_Q3T8nYznA_lni7vQ/s320/Screenshot+from+2015-07-19+10%253A13%253A43.png" width="320" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
The Score and speed displayed after crashing into an opponent</div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div style="text-align: left;">
you will see that the game looks really good at this point , however , we still need to add an option to replay the game,instead of just quitting the game after the player loses. that will require some restructuring of the code. but we'll leave that for some other time</div>
<blockquote class="tr_bq">
The code for this post can be found at the <a href="https://github.com/PrashantMohta/Cgame" target="_blank">Git repo</a> in the file "<a href="https://github.com/PrashantMohta/Cgame/blob/master/Cgame_part3.py" target="_blank">Cgame_part3.py</a>"</blockquote>
<br />
<br />
<br /></div>
Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-7273039283046031779.post-87434202342175140292015-07-14T23:48:00.000+05:302015-07-14T23:55:07.861+05:30Making a Python game - Obstacles - Part 3In the previous posts in this series , we have seen the following parts to making our game.<br />
<ol>
<li><a href="http://gadget-geek-prashant.blogspot.com/2015/07/making-python-game-preparation-part-1.html">Setting up our system</a></li>
<li><a href="http://gadget-geek-prashant.blogspot.in/2015/07/making-python-game-basic-io-part-2.html#.VaUxXnWlyko">Basic input and output</a></li>
</ol>
<div class="separator" style="clear: both;">
so far our game displays as such :</div>
<br />
<br />
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiWp7QMXvBkfjX4RK8ldAoyq-4zMG2tXZu4TvjmztYkC3Y1v4-Hl4_tXnIMZ5x7g_RsCOmqgm1WcD37UnKUstTKRB6d150yPjsLDj1FF2zEztxi8zc0sHCCCGT2ihD_IUZUI4fsORCnIiw/s1600/Screenshot+%2528190%2529.png"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiWp7QMXvBkfjX4RK8ldAoyq-4zMG2tXZu4TvjmztYkC3Y1v4-Hl4_tXnIMZ5x7g_RsCOmqgm1WcD37UnKUstTKRB6d150yPjsLDj1FF2zEztxi8zc0sHCCCGT2ihD_IUZUI4fsORCnIiw/s1600/Screenshot+%2528190%2529.png" /></a><br />
<br />
<br />
Now let's add the obstacles , so we need to keep in mind the following :<br />
<div>
<ul style="margin: 0.5em 0px; padding: 0px 2.5em;">
<li style="background-color: white; border-image-outset: initial; border-image-repeat: initial; border-image-slice: initial; border-image-source: initial; border-image-width: initial; border: none; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; line-height: 1.4; margin: 0px 0px 0.25em; padding: 0.25em 0px;">We need to move the screen so that the generated objects move towards the player.</li>
<li style="background-color: white; border-image-outset: initial; border-image-repeat: initial; border-image-slice: initial; border-image-source: initial; border-image-width: initial; border: none; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; line-height: 1.4; margin: 0px 0px 0.25em; padding: 0.25em 0px;">We need our obstacles to generate randomly , but not block the player's route completely .</li>
<li style="background-color: white; border-image-outset: initial; border-image-repeat: initial; border-image-slice: initial; border-image-source: initial; border-image-width: initial; border: none; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; line-height: 1.4; margin: 0px 0px 0.25em; padding: 0.25em 0px;">We need to give player points for dodging every obstacle, for the score.</li>
<li style="background-color: white; border-image-outset: initial; border-image-repeat: initial; border-image-slice: initial; border-image-source: initial; border-image-width: initial; border: none; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; line-height: 1.4; margin: 0px 0px 0.25em; padding: 0.25em 0px;">We need to progressively increase the rate of the obstacle generation , and movement speed ,making the game harder to play as time goes on.</li>
</ul>
lets look at the additions to the code , now that we know our objectives ,<br />
<br />
first of all , we need to import new modules, "time and random".<br />
<div>
<br />
<table class="highlight tab-size js-file-line-container" data-tab-size="8" style="border-collapse: collapse; border-spacing: 0px; box-sizing: border-box; color: #333333; font-family: Helvetica, arial, nimbussansl, liberationsans, freesans, clean, sans-serif, 'Segoe UI Emoji', 'Segoe UI Symbol'; font-size: 13px; line-height: 18.2000007629395px; tab-size: 8;"><tbody style="box-sizing: border-box;">
<tr style="box-sizing: border-box;"></tr>
<tr style="box-sizing: border-box;"><td class="blob-code blob-code-inner js-file-line" id="LC1" style="box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 12px; overflow: visible; padding: 0px 10px; position: relative; vertical-align: top; white-space: pre; word-wrap: normal;"><span style="background-color: white;"><span class="pl-k" style="box-sizing: border-box; color: #a71d5d;">import</span> mlcd,pygame,time,random</span></td></tr>
<tr style="box-sizing: border-box;"><td class="blob-num js-line-number" data-line-number="2" id="L2" style="-webkit-user-select: none; border-color: rgb(238, 238, 238); border-style: solid; border-width: 0px 1px 0px 0px; box-sizing: border-box; color: rgba(0, 0, 0, 0.298039); cursor: pointer; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 12px; line-height: 18px; min-width: 50px; padding: 0px 10px; text-align: right; vertical-align: top; white-space: nowrap; width: 50px;"></td></tr>
</tbody></table>
<br />
the "time" modules provides us timing functions so that the logic runs at a set "speed" and "random" module allows us to make random decisions.<br />
<br />
next , we will add some more constants and variables.<br />
<br />
<span style="background-color: white; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; line-height: 18.2000007629395px;"><span style="color: #333333; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 12px; line-height: 16.7999992370605px; white-space: pre;">OBSTACLE_CHAR</span><span class="pl-k" style="box-sizing: border-box; color: #a71d5d; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 12px; line-height: 16.7999992370605px; white-space: pre;">=</span><span class="pl-s" style="box-sizing: border-box; color: #183691; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 12px; line-height: 16.7999992370605px; white-space: pre;"><span class="pl-pds" style="box-sizing: border-box;">"</span>|<span class="pl-pds" style="box-sizing: border-box;">"</span></span><br /><span style="color: #333333; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 12px; line-height: 16.7999992370605px; white-space: pre;">game</span><span class="pl-k" style="box-sizing: border-box; color: #a71d5d; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 12px; line-height: 16.7999992370605px; white-space: pre;">=</span><span style="color: #333333; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 12px; line-height: 16.7999992370605px; white-space: pre;">{</span><span class="pl-s" style="box-sizing: border-box; color: #183691; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 12px; line-height: 16.7999992370605px; white-space: pre;"><span class="pl-pds" style="box-sizing: border-box;">"</span>speed<span class="pl-pds" style="box-sizing: border-box;">"</span></span><span style="color: #333333; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 12px; line-height: 16.7999992370605px; white-space: pre;">:</span><span class="pl-c1" style="box-sizing: border-box; color: #0086b3; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 12px; line-height: 16.7999992370605px; white-space: pre;">4.05</span><span style="color: #333333; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 12px; line-height: 16.7999992370605px; white-space: pre;">,</span><span class="pl-s" style="box-sizing: border-box; color: #183691; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 12px; line-height: 16.7999992370605px; white-space: pre;"><span class="pl-pds" style="box-sizing: border-box;">"</span>level<span class="pl-pds" style="box-sizing: border-box;">"</span></span><span style="color: #333333; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 12px; line-height: 16.7999992370605px; white-space: pre;">:</span><span class="pl-c1" style="box-sizing: border-box; color: #0086b3; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 12px; line-height: 16.7999992370605px; white-space: pre;">2.5</span><span style="color: #333333; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 12px; line-height: 16.7999992370605px; white-space: pre;">,</span><span class="pl-s" style="box-sizing: border-box; color: #183691; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 12px; line-height: 16.7999992370605px; white-space: pre;"><span class="pl-pds" style="box-sizing: border-box;">"</span>obstacle<span class="pl-pds" style="box-sizing: border-box;">"</span></span><span style="color: #333333; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 12px; line-height: 16.7999992370605px; white-space: pre;">:</span><span class="pl-c1" style="box-sizing: border-box; color: #0086b3; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 12px; line-height: 16.7999992370605px; white-space: pre;">0</span><span style="color: #333333; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 12px; line-height: 16.7999992370605px; white-space: pre;">} </span></span></div>
</div>
<div style="font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; line-height: 18.2000007629395px;">
<span style="background-color: white;"><span style="color: #333333; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 12px; line-height: 16.7999992370605px; white-space: pre;">lasttime</span><span class="pl-k" style="box-sizing: border-box; color: #a71d5d; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 12px; line-height: 16.7999992370605px; white-space: pre;">=</span><span style="color: #333333; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 12px; line-height: 16.7999992370605px; white-space: pre;">time.time()</span></span></div>
<div>
<span style="background-color: white; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; line-height: 18.2000007629395px;"><span style="color: #333333; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 12px; line-height: 16.7999992370605px; white-space: pre;">curtime</span><span class="pl-k" style="box-sizing: border-box; color: #a71d5d; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 12px; line-height: 16.7999992370605px; white-space: pre;">=</span></span><span class="pl-c1" style="box-sizing: border-box;"><span style="color: #0086b3; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 12px; line-height: 16.7999992370605px; white-space: pre;"><span style="background-color: white;">0.0</span></span></span></div>
<div>
<span class="pl-c1" style="box-sizing: border-box;"><span style="color: #0086b3; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 12px; line-height: 16.7999992370605px; white-space: pre;"><span style="background-color: white;"><br /></span></span></span></div>
"OBSTACLE_CHAR" stores our obstacles, again like the "PLAYER_CHAR" it can be changed ,just keep it a single character. "game" dictionary stores the movement speed, current level and obstacle count for the game."lasttime" and "curtime" , store the time to check if the game logic is running at a certain speed (not faster than human capability) <br />
<br />
<br />
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjsig5NSTOM2iO4qpM4zoQGhrBH0H2tgrsL44vaFq7wpndbuzyIm3V0gbfZ-pbkR9JKuplbIf2hg7iLBBn1ckjBi0Z0NS4s8tNwgWtkJ5XBLliBvq7dRA43kx0O3YeHgPJYasvbVm4kQas/s1600/Screenshot+from+2015-07-14+23%253A26%253A01.png"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjsig5NSTOM2iO4qpM4zoQGhrBH0H2tgrsL44vaFq7wpndbuzyIm3V0gbfZ-pbkR9JKuplbIf2hg7iLBBn1ckjBi0Z0NS4s8tNwgWtkJ5XBLliBvq7dRA43kx0O3YeHgPJYasvbVm4kQas/s320/Screenshot+from+2015-07-14+23%253A26%253A01.png" /></a><br />
<br />
<br />
<br />
now we begin by adding the speed check for our game logic,inside the game loop,<br />
we get the current time and see<br />
<span style="font-family: inherit;"> if 1/speed time has passed,if yes then update </span><br />
<br />
variable for lasttime and then run the code for logic. <br />
<br />
<br />
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjb3PWq-5zn9BOVsK1BCq7N8oBt2Z-JHQ7Hmu-yak5JFUvmPp07JnTf9RdegXEj-wgQ7JNlkdJjmKnZNJRr5PbnJK-mjhM-BqM5TchCSowGQVZ7zCnPpuYQ45rl4MsAtr6y3hB9yxvOEtE/s1600/Screenshot+from+2015-07-14+23%253A27%253A42.png"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjb3PWq-5zn9BOVsK1BCq7N8oBt2Z-JHQ7Hmu-yak5JFUvmPp07JnTf9RdegXEj-wgQ7JNlkdJjmKnZNJRr5PbnJK-mjhM-BqM5TchCSowGQVZ7zCnPpuYQ45rl4MsAtr6y3hB9yxvOEtE/s640/Screenshot+from+2015-07-14+23%253A27%253A42.png" /></a><br />
<br />
<br />
<br />
The above section of the code , checks if the player and the obstacle are at the same column, and if true , updates the values for score,level and speed being on the same line means from next cycle the obstacle cant cause any problems for the player , hence we also remove it from the count of current obstacles.<br />
<div>
<div>
<br />
<br />
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjJPy05XExYqg7jYiP01xkjdLlFAHzftFUhSKO5GXuKD6Ub8ndwcp9nOCZxqN9avKiHbKM6HERcKmEADD_7uevKCKCuh8JPF35El7o-UHUn_6o6kB318RLEH1LU29DSVYDB4SN2_mZyczE/s1600/Screenshot+from+2015-07-14+23%253A31%253A58.png"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjJPy05XExYqg7jYiP01xkjdLlFAHzftFUhSKO5GXuKD6Ub8ndwcp9nOCZxqN9avKiHbKM6HERcKmEADD_7uevKCKCuh8JPF35El7o-UHUn_6o6kB318RLEH1LU29DSVYDB4SN2_mZyczE/s400/Screenshot+from+2015-07-14+23%253A31%253A58.png" /></a><br />
<br />
<br />
we now move every character (except for player) one position to the left,but you will realize that once we do that, the leftmost characters are lost and the rightmost positions have no new values(the old ones are garbage for us). so now we need to add  new characters to the rightmost position , which will either be blank space(" ") or our "OBSTACLE_CHAR" in a random fashion, provided it doesn't block the path completely.The code for doing this is here.</div>
<div>
<div>
<pre class="line-pre" style="box-sizing: border-box; width: 1585px;"><span class="pl-c1" style="box-sizing: border-box;"><div class="line" id="file-gistfile1-py-LC53" style="box-sizing: border-box;">
<pre class="line-pre" style="box-sizing: border-box; width: 1585px;"><div class="line" id="file-gistfile1-py-LC73" style="box-sizing: border-box;">
<pre class="line-pre" style="box-sizing: border-box; width: 1585px;"><div class="line" id="file-gistfile1-py-LC76" style="box-sizing: border-box;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgMQhhTqpg-df696QVnpx8ZMVDaRn8Ys7SrpaHPXC1SKynBf4YhYpMcGSPuxM0_D-qQkAlPnOB2tpFQFHbKGtds0ansaS8luYkzbmWQ6EJA0c_Tl5r52gR_CxSgW6Uyd7tBcWvVx9f14pE/s1600/Screenshot+from+2015-07-14+23%253A33%253A18.png"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgMQhhTqpg-df696QVnpx8ZMVDaRn8Ys7SrpaHPXC1SKynBf4YhYpMcGSPuxM0_D-qQkAlPnOB2tpFQFHbKGtds0ansaS8luYkzbmWQ6EJA0c_Tl5r52gR_CxSgW6Uyd7tBcWvVx9f14pE/s640/Screenshot+from+2015-07-14+23%253A33%253A18.png" /></a>
Now,all we are left to add is the obstacle collision,<br />
<span style="background-color: white;">
</span><span class="pl-c1" style="box-sizing: border-box; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; line-height: 18.2000007629395px;"><span style="background-color: white; color: #333333; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 12px; line-height: 16.7999992370605px;"> <span class="pl-c" style="box-sizing: border-box; color: #969896;">#check for collision</span></span></span></div>
<span class="pl-c1" style="box-sizing: border-box;"><div class="line" id="file-gistfile1-py-LC77" style="box-sizing: border-box; color: #333333; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 12px; line-height: 16.7999992370605px;">
<span style="background-color: white;"> <span class="pl-k" style="box-sizing: border-box; color: #a71d5d;">if</span> screenbuff[player[<span class="pl-s1" style="box-sizing: border-box; color: #df5000;"><span class="pl-pds" style="box-sizing: border-box;">"</span>line<span class="pl-pds" style="box-sizing: border-box;">"</span></span>]][player[<span class="pl-s1" style="box-sizing: border-box; color: #df5000;"><span class="pl-pds" style="box-sizing: border-box;">"</span>position<span class="pl-pds" style="box-sizing: border-box;">"</span></span>]]<span class="pl-k" style="box-sizing: border-box; color: #a71d5d;">==</span>OBSTACLE_CHAR:</span><br />
<span style="color: #333333; font-family: Consolas, Liberation Mono, Menlo, Courier, monospace;"><span style="background-color: white; line-height: 16.7999992370605px;"> done</span></span><span class="pl-k" style="background-color: white; box-sizing: border-box; color: #a71d5d; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; line-height: 16.7999992370605px;">=</span><span class="pl-c1" style="background-color: white; box-sizing: border-box; color: #0086b3; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; line-height: 16.7999992370605px;">True</span><span style="color: #333333; font-family: Consolas, Liberation Mono, Menlo, Courier, monospace;"><span style="background-color: white; line-height: 16.7999992370605px;"> </span></span><span class="pl-c" style="background-color: white; box-sizing: border-box; color: #969896; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; line-height: 16.7999992370605px;">#player lost</span><br />
<span class="pl-c" style="background-color: white; box-sizing: border-box; color: #969896; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; line-height: 16.7999992370605px;">
</span></div>
after the "done=True" you may also add a "print" statement to display the final score
in your console , however we will add a start screen , instructions and an endscreen
which will display the code and instructions on how to play the game on the LCD
itself, in a future post.
Here are some screenshots of the game ,as it is now, </span></pre>
</div>
</pre>
</div>
<div class="line" id="file-gistfile1-py-LC53" style="box-sizing: border-box;">
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjKjLJ0B26EdyqK_utlUoyVbGpoIgM6Y8NQjjjOc123xn4HcVcx2YGJqJ8R8uYpSHO1UEjhRZp7uOhyphenhyphenvQiY7uRzzxWn1hl4GBGmlOqMxTFG2u4J2qbwqbGGk8Zdz0K6gRnz8-0ew9HMH78/s1600/Screenshot+from+2015-07-14+23%253A11%253A35.png" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjKjLJ0B26EdyqK_utlUoyVbGpoIgM6Y8NQjjjOc123xn4HcVcx2YGJqJ8R8uYpSHO1UEjhRZp7uOhyphenhyphenvQiY7uRzzxWn1hl4GBGmlOqMxTFG2u4J2qbwqbGGk8Zdz0K6gRnz8-0ew9HMH78/s1600/Screenshot+from+2015-07-14+23%253A11%253A35.png" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEibCZ3fACpBpKP-x6zDvxtzRjW_9KLdTDhbNFn3-Zpx7WY4mPb6Qs4380vdHm_9LL3m6cFQoqFyds_3Mq3BwruJXzkxqr0efY_E-DXMuM6z9ua3UoCDNIxxap3KQJML15__eUCGMAWlY3A/s1600/Screenshot+from+2015-07-14+23%253A11%253A45.png" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEibCZ3fACpBpKP-x6zDvxtzRjW_9KLdTDhbNFn3-Zpx7WY4mPb6Qs4380vdHm_9LL3m6cFQoqFyds_3Mq3BwruJXzkxqr0efY_E-DXMuM6z9ua3UoCDNIxxap3KQJML15__eUCGMAWlY3A/s1600/Screenshot+from+2015-07-14+23%253A11%253A45.png" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgg_hPRqWAazwr_yBPQfxdifCjrqbU9odHUYV7-_G3XZmhdtWnP-CrKzVc5ArePD4mBf0eDuAMjDXzkvtP_PiikF5ZxgXF5umOKcrlE_9EKbR1tktLNlO3R7YAbZN3LfgDLteLj07fSOvM/s1600/Screenshot+from+2015-07-14+23%253A12%253A25.png" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgg_hPRqWAazwr_yBPQfxdifCjrqbU9odHUYV7-_G3XZmhdtWnP-CrKzVc5ArePD4mBf0eDuAMjDXzkvtP_PiikF5ZxgXF5umOKcrlE_9EKbR1tktLNlO3R7YAbZN3LfgDLteLj07fSOvM/s1600/Screenshot+from+2015-07-14+23%253A12%253A25.png" /></a></div>
</div>
<div class="line" id="file-gistfile1-py-LC53" style="box-sizing: border-box;">
</div>
<div class="line" id="file-gistfile1-py-LC53" style="box-sizing: border-box;">
</div>
<div class="line" id="file-gistfile1-py-LC53" style="box-sizing: border-box;">
</div>
<div class="line" id="file-gistfile1-py-LC53" style="box-sizing: border-box;">
</div>
<div class="line" id="file-gistfile1-py-LC53" style="box-sizing: border-box;">
</div>
<div class="line" id="file-gistfile1-py-LC53" style="box-sizing: border-box;">
Code for this post is available on the <a href="https://github.com/PrashantMohta/Cgame">git repo</a> as the new file <span style="background-color: white; color: #333333; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13px; line-height: 18.2000007629395px;"><span style="font-size: 12px; line-height: 16.7999992370605px;">"</span></span><a href="https://github.com/PrashantMohta/Cgame/blob/master/Cgame_part2.py" style="background-color: white; color: #46a784; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; line-height: 18.2000007629395px;">Cgame_part2.py</a><span style="background-color: white; color: #333333; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 12px; line-height: 16.7999992370605px;">"</span></div>
</span></pre>
</div>
</div>
</div>
Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-7273039283046031779.post-30642763568561743832015-07-11T21:53:00.004+05:302015-07-14T23:52:36.902+05:30Making a Python game -Basic I/O-Part 2In the previous post , <a href="http://gadget-geek-prashant.blogspot.in/2015/07/making-python-game-preparation-part-1.html" target="_blank">we setup our system and prepared our working directory</a> , in this post we will begin with coding a few key components of the game , and see how they work.<br />
<ul>
<li>Open the "<span style="background-color: white; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; line-height: 18.2000007629395px;">Cgame_part1.py" by right clicking and selecting "edit with IDLE" , or you may use notepad if you prefer , i just like using IDLE because u can run the programs directly.<br /><span style="line-height: 18.2000007629395px;"><br /></span></span></li>
<li><span style="background-color: white; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; line-height: 18.2000007629395px;">You can download the code from my<a href="https://github.com/PrashantMohta/Cgame" target="_blank"> Git Repo </a>directly , so focus on understanding what each bit does in this post.</span></li>
</ul>
<h2>
<span style="font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: small;"><span style="background-color: white; font-weight: normal; line-height: 18.2000007629395px;">Coding the basic components</span></span></h2>
<div>
<ol>
<li><span style="font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif;"><span style="line-height: 18.2000007629395px;">Begin by importing the modules needed for this part of the game.</span><br /><br /><span style="line-height: 18.2000007629395px;"><span style="background-color: #eeeeee;">import mlcd,pygame</span><br /><br /><span style="background-color: white;">This allows us to use the functions contained in these modules, so we can use them in our game</span></span></span></li>
<li><span style="font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif;"><span style="line-height: 18.2000007629395px;"><span style="background-color: white;">Next we create a few constants and variables to store the state of our game, we will discuss them as they come up.</span></span></span><span style="background-color: white; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; line-height: 18.2000007629395px;"><br /></span><span style="background-color: #eeeeee; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; line-height: 18.2000007629395px;">PLAYER_CHAR=">"</span><br /><br /><span style="font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif;"><span style="background-color: white; line-height: 18.2000007629395px;">This constant basically defines how our player is going to look on the screen, changing this will change the shape of our ship , you are free to play with this value, but remember to keep it a single character.</span></span><br /><span style="background-color: #eeeeee; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; line-height: 18.2000007629395px;">screenbuff=[[" "," "," "," "," "," "," "," "," "," "," "," "],</span><span style="background-color: #eeeeee; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; line-height: 18.2000007629395px;"> [" "," "," "," "," "," "," "," "," "," "," "," "]]</span><br /><br /><span style="font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif;"><span style="background-color: white; line-height: 18.2000007629395px;">This variable stores the state of that part of the screen where our obstacles and ship will be,think of it like a virtual map of the playable area on the screen.</span></span><span style="background-color: #eeeeee; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; line-height: 18.2000007629395px;"><br />player={"position":0,"line":0,"score":000} </span><span style="font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; line-height: 18.2000007629395px;"><span style="background-color: #eeeeee;">keys={"space":False,"quit":False}</span><br /><span style="background-color: white;">These are two "dictionary" type variables to store the states of the pressed keys and the player's position and score.</span></span></li>
<li><span style="font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif;"><span style="background-color: white; line-height: 18.2000007629395px;">Now that we are done with creating the variables we need to use , we will create a function that will allow us to get the pressed keys using pygame.</span></span><span style="background-color: #eeeeee; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; line-height: 18.2000007629395px;"><br />def keypress(): (refer to the code from git repo)</span><span style="background-color: #eeeeee; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; line-height: 18.2000007629395px;"><br /></span></li>
<li><span style="font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif;"><span style="line-height: 18.2000007629395px;">The function first resets the keystates so that we don't get duplicate keypresses,</span></span><br /><span style="font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif;"><span style="line-height: 18.2000007629395px;">then it checks the pygame key events and sets our keystate to true if the key is pressed and crosschecks it with a key up or key down event to ensure we don't send the keys if the key has been pressed and never released(which would cause the game to move things too fast).</span></span></li>
<li><span style="font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif;"><span style="line-height: 18.2000007629395px;">Now we can move on to the main part , the game loop,</span></span></li>
</ol>
<span style="background-color: #eeeeee;"><span style="font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; line-height: 18.2000007629395px;"> </span><span style="font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif;"><span style="line-height: 18.2000007629395px;">done=False</span></span></span></div>
<div>
<span style="background-color: #eeeeee;"><span style="font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; line-height: 18.2000007629395px;"> </span><span style="font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif;"><span style="line-height: 18.2000007629395px;">#initialize mlcd as 16x2 character lcd</span></span></span></div>
<div>
<span style="background-color: #eeeeee;"><span style="font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; line-height: 18.2000007629395px;"> </span><span style="font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif;"><span style="line-height: 18.2000007629395px;">mlcd.init(16,2)</span></span></span></div>
<div>
<span style="background-color: #eeeeee;"><span style="font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; line-height: 18.2000007629395px;"> </span><span style="font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif;"><span style="line-height: 18.2000007629395px;">while not done:</span></span></span></div>
<div>
<span style="background-color: #eeeeee;"><span style="font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif;"><span style="line-height: 18.2000007629395px;"> </span></span><span style="font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; line-height: 18.2000007629395px;"> </span><span style="font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; line-height: 18.2000007629395px;">#add player to the buffer</span></span></div>
<div>
<span style="background-color: #eeeeee;"><span style="font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif;"><span style="line-height: 18.2000007629395px;"> </span></span><span style="font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; line-height: 18.2000007629395px;"> </span><span style="font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; line-height: 18.2000007629395px;">screenbuff[player["line"]][player["position"]]=PLAYER_CHAR</span></span></div>
<div>
<span style="background-color: #eeeeee;"><span style="font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif;"><span style="line-height: 18.2000007629395px;"> </span></span><span style="font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; line-height: 18.2000007629395px;"> </span><span style="font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; line-height: 18.2000007629395px;">#ready the lines for drawing on lcd</span></span></div>
<div>
<span style="background-color: #eeeeee;"><span style="font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif;"><span style="line-height: 18.2000007629395px;"> </span></span><span style="font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; line-height: 18.2000007629395px;"> </span><span style="font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; line-height: 18.2000007629395px;">lines=[''.join(screenbuff[0]) + "|scr",</span></span></div>
<div>
<span style="background-color: #eeeeee;"><span style="font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif;"><span style="line-height: 18.2000007629395px;"> </span></span><span style="font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; line-height: 18.2000007629395px;"> </span><span style="font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; line-height: 18.2000007629395px;"> ''.join(screenbuff[1]) + "|"+str(player["score"])]</span></span></div>
<div>
<span style="background-color: #eeeeee;"><span style="font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif;"><span style="line-height: 18.2000007629395px;"> </span></span><span style="font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; line-height: 18.2000007629395px;"> </span><span style="font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; line-height: 18.2000007629395px;">mlcd.draw(lines)</span></span></div>
<div>
<span style="background-color: #eeeeee;"><span style="font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif;"><span style="line-height: 18.2000007629395px;"> </span></span><span style="font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; line-height: 18.2000007629395px;"> </span><span style="font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; line-height: 18.2000007629395px;">#remove player from buffer</span></span></div>
<div>
<span style="background-color: #eeeeee;"><span style="font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif;"><span style="line-height: 18.2000007629395px;"> </span></span><span style="font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; line-height: 18.2000007629395px;"> </span><span style="font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; line-height: 18.2000007629395px;">screenbuff[player["line"]][player["position"]]=" "</span></span></div>
<div>
<span style="background-color: #eeeeee;"><span style="font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif;"><span style="line-height: 18.2000007629395px;"> </span></span><span style="font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; line-height: 18.2000007629395px;"> </span><span style="font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; line-height: 18.2000007629395px;">#get keypresses</span></span></div>
<div>
<span style="background-color: #eeeeee;"><span style="font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif;"><span style="line-height: 18.2000007629395px;"> </span></span><span style="font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; line-height: 18.2000007629395px;"> </span><span style="font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; line-height: 18.2000007629395px;">keypress()</span></span></div>
<div>
<span style="background-color: #eeeeee;"><span style="font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif;"><span style="line-height: 18.2000007629395px;"> </span></span><span style="font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; line-height: 18.2000007629395px;"> </span><span style="font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; line-height: 18.2000007629395px;">#modify player line (move the player) if space is pressed</span></span></div>
<div>
<span style="background-color: #eeeeee;"><span style="font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif;"><span style="line-height: 18.2000007629395px;"> </span></span><span style="font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; line-height: 18.2000007629395px;"> </span><span style="font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; line-height: 18.2000007629395px;">if keys["space"]:</span></span></div>
<div>
<span style="background-color: #eeeeee;"><span style="font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif;"><span style="line-height: 18.2000007629395px;"> </span></span><span style="font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; line-height: 18.2000007629395px;"> </span><span style="font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; line-height: 18.2000007629395px;">if player["line"]==0:</span></span></div>
<div>
<span style="background-color: #eeeeee;"><span style="font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif;"><span style="line-height: 18.2000007629395px;"> </span></span><span style="font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; line-height: 18.2000007629395px;"> </span><span style="font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; line-height: 18.2000007629395px;">player["line"]=1</span></span></div>
<div>
<span style="background-color: #eeeeee;"><span style="font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif;"><span style="line-height: 18.2000007629395px;"> </span></span><span style="font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; line-height: 18.2000007629395px;"> </span><span style="font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; line-height: 18.2000007629395px;">else:</span></span></div>
<div>
<span style="background-color: #eeeeee;"><span style="font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif;"><span style="line-height: 18.2000007629395px;"> </span></span><span style="font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; line-height: 18.2000007629395px;"> </span><span style="font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; line-height: 18.2000007629395px;">player["line"]=0</span></span></div>
<div>
<span style="background-color: #eeeeee;"><span style="font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif;"><span style="line-height: 18.2000007629395px;"> </span></span><span style="font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; line-height: 18.2000007629395px;"> </span><span style="font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; line-height: 18.2000007629395px;">#quit</span></span></div>
<div>
<span style="background-color: #eeeeee;"><span style="font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif;"><span style="line-height: 18.2000007629395px;"> </span></span><span style="font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; line-height: 18.2000007629395px;"> </span><span style="font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; line-height: 18.2000007629395px;">if keys["quit"]:</span></span></div>
<div>
<span style="background-color: #eeeeee;"><span style="font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif;"><span style="line-height: 18.2000007629395px;"> </span></span><span style="font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; line-height: 18.2000007629395px;"> </span><span style="font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; line-height: 18.2000007629395px;">print("game quit")</span></span></div>
<div>
<span style="background-color: #eeeeee;"><span style="font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif;"><span style="line-height: 18.2000007629395px;"> </span></span><span style="font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; line-height: 18.2000007629395px;"> </span><span style="font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; line-height: 18.2000007629395px;">done=True</span></span></div>
<div>
<h2>
Break down of the game loop</h2>
</div>
<div>
Before the loop begins,we set the control variable "done" to False , and initialize the mlcd display,<br />
<br />
<ol>
<li>first , we add the player to the screenbuff, so that the entire gameplay data is ready to be put on the screen ,we do this with the line<br /><br /><span style="font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif;"><span style="line-height: 18.2000007629395px;"> </span></span><span style="font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; line-height: 18.2000007629395px;"> </span><span style="background-color: #eeeeee; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; line-height: 18.2000007629395px;">screenbuff[player["line"]][player["position"]]=PLAYER_CHAR</span></li>
<li><span style="font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif;"><span style="line-height: 18.2000007629395px;"><span style="background-color: white;">with the next two lines , we create a list, containing the gameplay data , and the score , and display the entire data on to the screen.</span><div style="font-family: 'Times New Roman'; line-height: normal;">
<span style="background-color: #eeeeee;"><span style="font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif;"><span style="line-height: 18.2000007629395px;"> </span></span><span style="font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; line-height: 18.2000007629395px;"> </span><span style="font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; line-height: 18.2000007629395px;">lines=[''.join(screenbuff[0]) + "|scr",</span></span></div>
<div style="font-family: 'Times New Roman'; line-height: normal;">
<span style="background-color: #eeeeee;"><span style="font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif;"><span style="line-height: 18.2000007629395px;"> </span></span><span style="font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; line-height: 18.2000007629395px;"> </span><span style="font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; line-height: 18.2000007629395px;"> ''.join(screenbuff[1]) + "|"+str(player["score"])]</span></span></div>
<div style="font-family: 'Times New Roman'; line-height: normal;">
<span style="background-color: #eeeeee;"><span style="font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif;"><span style="line-height: 18.2000007629395px;"> </span></span><span style="font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; line-height: 18.2000007629395px;"> </span><span style="font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; line-height: 18.2000007629395px;">mlcd.draw(lines)</span></span></div>
</span></span></li>
<li><div>
<span style="font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif;"><span style="background-color: white; line-height: 18.2000007629395px;">on the next line , we remove the player character from the gameplay data in the screenbuff, so that we don't end up putting the player character in it's last position.</span></span><br />
<div style="font-family: 'Times New Roman'; line-height: normal;">
<span style="font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif;"><span style="background-color: white; line-height: 18.2000007629395px;"><span style="background-color: #eeeeee;"><span style="font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif;"><span style="line-height: 18.2000007629395px;"> </span></span><span style="font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; line-height: 18.2000007629395px;"> </span><span style="font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; line-height: 18.2000007629395px;">#remove player from buffer</span></span></span></span></div>
<span style="font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif;"><span style="background-color: white; line-height: 18.2000007629395px;">
</span></span>
<br />
<div style="font-family: 'Times New Roman'; line-height: normal;">
<span style="font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif;"><span style="background-color: white; line-height: 18.2000007629395px;"><span style="background-color: #eeeeee;"><span style="font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif;"><span style="line-height: 18.2000007629395px;"> </span></span><span style="font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; line-height: 18.2000007629395px;"> </span><span style="font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; line-height: 18.2000007629395px;">screenbuff[player["line"]][player["position"]]=" "</span></span></span></span></div>
<span style="font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif;"><span style="background-color: white; line-height: 18.2000007629395px;">
</span></span></div>
</li>
<li><div style="font-family: 'Times New Roman'; line-height: normal;">
<span style="background-color: white; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; line-height: 18.2000007629395px;">Next , we get the keypresses and if space is pressed ,the player character switches lanes and if esc is pressed , we quit the loop by setting the loop condition "done" to true.this works because our looping condition is "while not done".</span><br />
<div style="font-family: 'Times New Roman'; line-height: normal;">
<span style="background-color: white; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; line-height: 18.2000007629395px;"><span style="background-color: #eeeeee;"><span style="font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif;"><span style="line-height: 18.2000007629395px;"> </span></span><span style="font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; line-height: 18.2000007629395px;"> </span><span style="font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; line-height: 18.2000007629395px;">#get keypresses</span></span></span></div>
<span style="background-color: white; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; line-height: 18.2000007629395px;">
</span>
<br />
<div style="font-family: 'Times New Roman'; line-height: normal;">
<span style="background-color: white; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; line-height: 18.2000007629395px;"><span style="background-color: #eeeeee;"><span style="font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif;"><span style="line-height: 18.2000007629395px;"> </span></span><span style="font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; line-height: 18.2000007629395px;"> </span><span style="font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; line-height: 18.2000007629395px;">keypress()</span></span></span></div>
<span style="background-color: white; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; line-height: 18.2000007629395px;">
</span>
<div style="font-family: 'Times New Roman'; line-height: normal;">
<span style="background-color: white; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; line-height: 18.2000007629395px;"><span style="background-color: #eeeeee;"><span style="font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif;"><span style="line-height: 18.2000007629395px;"> </span></span><span style="font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; line-height: 18.2000007629395px;"> </span><span style="font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; line-height: 18.2000007629395px;">#modify player line (move the player) if space is pressed</span></span></span></div>
<span style="background-color: white; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; line-height: 18.2000007629395px;">
<div style="font-family: 'Times New Roman'; line-height: normal;">
<span style="background-color: #eeeeee;"><span style="font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif;"><span style="line-height: 18.2000007629395px;"> </span></span><span style="font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; line-height: 18.2000007629395px;"> </span><span style="font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; line-height: 18.2000007629395px;">if keys["space"]:</span></span></div>
<div style="font-family: 'Times New Roman'; line-height: normal;">
<span style="background-color: #eeeeee;"><span style="font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif;"><span style="line-height: 18.2000007629395px;"> </span></span><span style="font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; line-height: 18.2000007629395px;"> </span><span style="font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; line-height: 18.2000007629395px;">if player["line"]==0:</span></span></div>
<div style="font-family: 'Times New Roman'; line-height: normal;">
<span style="background-color: #eeeeee;"><span style="font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif;"><span style="line-height: 18.2000007629395px;"> </span></span><span style="font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; line-height: 18.2000007629395px;"> </span><span style="font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; line-height: 18.2000007629395px;">player["line"]=1</span></span></div>
<div style="font-family: 'Times New Roman'; line-height: normal;">
<span style="background-color: #eeeeee;"><span style="font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif;"><span style="line-height: 18.2000007629395px;"> </span></span><span style="font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; line-height: 18.2000007629395px;"> </span><span style="font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; line-height: 18.2000007629395px;">else:</span></span></div>
<div style="font-family: 'Times New Roman'; line-height: normal;">
<span style="background-color: #eeeeee;"><span style="font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif;"><span style="line-height: 18.2000007629395px;"> </span></span><span style="font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; line-height: 18.2000007629395px;"> </span><span style="font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; line-height: 18.2000007629395px;">player["line"]=0</span></span></div>
<div style="font-family: 'Times New Roman'; line-height: normal;">
<span style="background-color: #eeeeee;"><span style="font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif;"><span style="line-height: 18.2000007629395px;"> </span></span><span style="font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; line-height: 18.2000007629395px;"> </span><span style="font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; line-height: 18.2000007629395px;">#quit</span></span></div>
<div style="font-family: 'Times New Roman'; line-height: normal;">
<span style="background-color: #eeeeee;"><span style="font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif;"><span style="line-height: 18.2000007629395px;"> </span></span><span style="font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; line-height: 18.2000007629395px;"> </span><span style="font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; line-height: 18.2000007629395px;">if keys["quit"]:</span></span></div>
<div style="font-family: 'Times New Roman'; line-height: normal;">
<span style="background-color: #eeeeee;"><span style="font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif;"><span style="line-height: 18.2000007629395px;"> </span></span><span style="font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; line-height: 18.2000007629395px;"> </span><span style="font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; line-height: 18.2000007629395px;">print("game quit")</span></span></div>
<div style="font-family: 'Times New Roman'; line-height: normal;">
<span style="background-color: #eeeeee;"><span style="font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif;"><span style="line-height: 18.2000007629395px;"> </span></span><span style="font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; line-height: 18.2000007629395px;"> </span><span style="font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; line-height: 18.2000007629395px;">done=True</span></span></div>
</span></div>
</li>
</ol>
<div>
<span style="font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif;"><span style="line-height: 18.2000007629395px;">That ends the game loop , outside the loop block , we simply add one line to exit pygame after we are done executing everything.</span><br /><br /><span style="line-height: 18.2000007629395px;"><span style="background-color: #eeeeee;"> pygame.quit()</span><br /><br /><br /><span style="background-color: white;">Running this program displays a tiny 16x2 character lcd box like so,</span></span></span><br />
<div class="separator" style="clear: both; text-align: center;">
<span style="font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif;"><span style="line-height: 18.2000007629395px;"><span style="background-color: white;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiWp7QMXvBkfjX4RK8ldAoyq-4zMG2tXZu4TvjmztYkC3Y1v4-Hl4_tXnIMZ5x7g_RsCOmqgm1WcD37UnKUstTKRB6d150yPjsLDj1FF2zEztxi8zc0sHCCCGT2ihD_IUZUI4fsORCnIiw/s1600/Screenshot+%2528190%2529.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiWp7QMXvBkfjX4RK8ldAoyq-4zMG2tXZu4TvjmztYkC3Y1v4-Hl4_tXnIMZ5x7g_RsCOmqgm1WcD37UnKUstTKRB6d150yPjsLDj1FF2zEztxi8zc0sHCCCGT2ihD_IUZUI4fsORCnIiw/s1600/Screenshot+%2528190%2529.png" /></a></span></span></span></div>
<span style="font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif;"><span style="line-height: 18.2000007629395px;"><span style="background-color: white;">
</span></span></span>
<br />
<div class="separator" style="clear: both; text-align: left;">
<span style="font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif;"><span style="line-height: 18.2000007629395px;"><span style="background-color: white;">and pressing the space key will switch the line of the player " > " and pressing the esc will quit the game. be sure to click the box , if your input doesn't respond , the window needs to be in focus for pygame to catch the key input.</span></span></span></div>
<span style="font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif;"><span style="line-height: 18.2000007629395px;"><span style="background-color: white;">
<br />
so there you go, you have the basic Input and output of the game ready. now all we need to add are the obstacles and their movement across the screen,then we add a difficulty system and a few instructions on how to play, and our first game ,will be ready !<br /><a href="http://gadget-geek-prashant.blogspot.com/2015/07/making-python-game-obstacles-part-3.html" target="_blank">EDIT: added in part 3</a><br />
<br />
if you are enjoying this series or have any questions , hit me up in the comments below , and i'll be glad to help<br />
</span></span></span></div>
</div>
Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-7273039283046031779.post-79830340891869372752015-07-11T17:48:00.001+05:302015-07-11T21:56:28.511+05:30Making a Python game - Preparation -part 1You've always wanted to make a game , but were too perplexed where to start ? maybe you think you don't have the right tools or the knowledge to make a game ? well , i'll be honest , making a game is no simple task, but, its not impossible, i will divide the process into a series so that its digestible.<br />
<div>
<br /></div>
<div>
Through this series, we will see how to make a simple game for a 16x2 lcd screen and at the end of the series we will try to make an expanded version of the game for a pc or a bigger lcd display,we will not be going into the details of interfacing a lcd with your raspberry pi in this series, we will begin right on with the game, because that's the fun bit.<br />
<br />
By the end of this series, your game will look (somewhat )like this:<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgMVY02tZTW2-ylFH3sbV_tVVUU-hzlubx_W87GDpFYRyq21OM-Mc7jmohmp786Qegoq82TTLGjxjOR0BoKnnmpEe4K2k9ceGe04cG8yXzmzG9E6GX_i_c8jPeHZlw86iGIW0A04dhAW8E/s1600/Screenshot+%2528189%2529.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgMVY02tZTW2-ylFH3sbV_tVVUU-hzlubx_W87GDpFYRyq21OM-Mc7jmohmp786Qegoq82TTLGjxjOR0BoKnnmpEe4K2k9ceGe04cG8yXzmzG9E6GX_i_c8jPeHZlw86iGIW0A04dhAW8E/s1600/Screenshot+%2528189%2529.png" /></a></div>
<div>
<h2>
Downloads</h2>
<div>
Before we begin you need to set up your programming environment, we will be working with python,and some of its modules , download them and follow the installation instructions by the respective provider to install them on your system.<br />
<br />
<ol>
<li><a href="https://www.python.org/downloads/" target="_blank">Python 2.7.x</a> - Python 3 may not be compatible, be sure to get 2.7.x</li>
<li><a href="http://www.pygame.org/download.shtml" target="_blank">Pygame</a> - Install Pygame appropriate to your system for python 2.7</li>
<li><a href="http://gadget-geek-prashant.blogspot.in/2015/07/writing-python-module-to-simulate-lcd.html" target="_blank">mlcd</a> - Download the module from Github link at the bottom of the page.</li>
</ol>
<h2>
Prepare your working folder</h2>
<div>
<ol>
<li>At a convenient location , on your computer, make a folder named "MyPygame"<br />this is the folder that will contain all our working files for this game.</li>
<li>Copy the mlcd module's folder in this directory , so that the module is accessible to our game.</li>
<li>Create a file "Cgame_part1.py" , this is the file that will have all our game logic.</li>
</ol>
<div>
Now that we have downloaded all the dependencies and prepared our working folder,we can look into starting the work with our game.<br />
<br />
The game is a simple obstacle avoidance game.we keep our ship in one of the two lanes on the screen, the randomly generated obstacles show up and the player needs to switch the lanes in time before they hit an obstacle,or it's "game over"<br />
<br />
simple enough, right? perfect for a beginner or as a weekend project !.<br />
<br /><b>Edit:</b>Head over to the<a href="http://gadget-geek-prashant.blogspot.com/2015/07/making-python-game-basic-io-part-2.html" target="_blank"> next part in this series , where we see the basic input and output of the game</a> laid out.<br /><br />
<br />
<br />
<br /></div>
</div>
<div>
<br /></div>
</div>
</div>
</div>
Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-7273039283046031779.post-76457647297425188102015-07-07T06:40:00.002+05:302015-07-07T06:40:36.253+05:30Prioritizing a uTorrent Download - The smarter waySo anyone who uses uTorrent knows this , at one point or the other , you end up downloading a lot of files on uTorrent and the bandwidth is shared between all those files , leading to slower download speeds for that one file you need urgently. <br />simplest solution is to <i>stop </i>all other downloads and let this one finish.However, this method has one shortcoming, u have to manually enable the next torrent you need , or your downloads will remain paused.surely,there must be some way to automate this process? Well,yes there is !<br />
<br />
<br />
<h2>
Prioritizing your downloads </h2>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiRNVl6dHtvB8oPDfL-0KsNkvMcwVqxsAeGsACdjaPOJHezpEPLw-BsHhpgWmfD0AOUH34o3ISDA-kSJuiRisCytLQrdOqaPleRDaaT4hQkIqN8it7mSNdtcjpXi2Q4MdD9lrhCiByavpw/s1600/Screenshot+%2528181%2529.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="72" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiRNVl6dHtvB8oPDfL-0KsNkvMcwVqxsAeGsACdjaPOJHezpEPLw-BsHhpgWmfD0AOUH34o3ISDA-kSJuiRisCytLQrdOqaPleRDaaT4hQkIqN8it7mSNdtcjpXi2Q4MdD9lrhCiByavpw/s400/Screenshot+%2528181%2529.png" width="400" /></a></div>
<div>
<br />
<ul>
<li>what we essentially want to do is get the torrent we want to download first, to the top of the list and pause all other torrents while it is downloading .Then,once that download is done , we want to download the immediate next torrent, while pausing all the others , automatically,</li>
</ul>
<br />
but wait , uTorrent is a Peer-to-Peer download client (all torrent clients are) , meaning that instead of getting the files from some servers , it gets them from other people who have downloaded the file already and are uploading it , they are called seeders.In case there aren't any seeders available, the above configuration will lead to no torrent downloading at all.!..</div>
<div>
There isn't a real solution to this issue, you can only hope you get enough seeders, but if you aren't getting to download your #1 file at the top speed allowed to you , you might as well download the next file in the list at the same time and so on.<br />
<br />
so lets set up such a configuration on uTorrent , I'll be setting it up for the top 2 torrents in the list to be downloaded first , you can also use this guide to increase that number , if you have a high speed internet connection,<br />
<h2>
Setting Maximum Number of Downloads</h2>
<div class="separator" style="clear: both; text-align: center;">
</div>
<ol>
<li style="text-align: left;">Start by opening Preferences by going into Options menu at the top<br /><div style="text-align: left;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiJdztwiCwdyYeJUBDrBF5fLlx0675Iwr8wtCIjXv6E35S75rVNdnLpZ7MX8WQCe9NBYj5B10PbcjWQDX6rZ8ic0uBIDUH6A_qm5LsuauI_l7YIrC4BHC5u6UM3nZ9R_CaXP2oGhzBwZck/s1600/Screenshot+%2528182%2529.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em; text-align: center;"><img border="0" height="126" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiJdztwiCwdyYeJUBDrBF5fLlx0675Iwr8wtCIjXv6E35S75rVNdnLpZ7MX8WQCe9NBYj5B10PbcjWQDX6rZ8ic0uBIDUH6A_qm5LsuauI_l7YIrC4BHC5u6UM3nZ9R_CaXP2oGhzBwZck/s320/Screenshot+%2528182%2529.png" width="320" /></a></div>
</li>
<li>In the Preferences box , click Queueing in the left panel<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhm42PX5N5oPHt3ViK5VOJe47ZTVKCfAft5sZVEp-HAB_5or0jy1xwzBhTA2TBJqvE8VC5KhvCAf3GCHLBE24JvdbITcOVSTYfWC6u-yzeKAsz8tybgd9GF7IApN7GyFbR2NUnzRRzZErY/s1600/Screenshot+%2528183%2529.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="220" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhm42PX5N5oPHt3ViK5VOJe47ZTVKCfAft5sZVEp-HAB_5or0jy1xwzBhTA2TBJqvE8VC5KhvCAf3GCHLBE24JvdbITcOVSTYfWC6u-yzeKAsz8tybgd9GF7IApN7GyFbR2NUnzRRzZErY/s320/Screenshot+%2528183%2529.png" width="320" /></a></div>
</li>
<li><div class="separator" style="clear: both; text-align: left;">
set maximum number of active downloads to 2 , you may choose a higher number but it'll divide your bandwidth, leading to a slower ,speed per torrent.</div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjwKOXqd0CMXFo5y2nprlC7RArEecUDOqaqJDPwWMKApwk3SZ-ZowcUQgkNgYAKOcyLJ79iAByLTs5jlwtYjTdxzTPScAQLVpTSevJOtUvgWsBAhVhkh2O3keBdT1jU0D1HBFQGXBkTRGY/s1600/Screenshot+%2528184%2529.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="144" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjwKOXqd0CMXFo5y2nprlC7RArEecUDOqaqJDPwWMKApwk3SZ-ZowcUQgkNgYAKOcyLJ79iAByLTs5jlwtYjTdxzTPScAQLVpTSevJOtUvgWsBAhVhkh2O3keBdT1jU0D1HBFQGXBkTRGY/s320/Screenshot+%2528184%2529.png" width="320" /></a></div>
</li>
<li><div class="separator" style="clear: both; text-align: left;">
Click OK and you should see that all but two of your downloads will say "Queued" , this means they are waiting for their turn to be downloaded.</div>
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhwY-XHcKBECztoluds5aztlsaXaDDy3Yv0fENtl8B-KbqEtG3j10f1eUqbrNwW8wDuzBcXMLU78YZSuzNC3T-dsO1Yrgyy45ap70iVA41NKMeHFKCGeP-sVl0OrY-9xG-iGGgUZ00_5Lw/s1600/Screenshot+%2528181%2529+-+Copy.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhwY-XHcKBECztoluds5aztlsaXaDDy3Yv0fENtl8B-KbqEtG3j10f1eUqbrNwW8wDuzBcXMLU78YZSuzNC3T-dsO1Yrgyy45ap70iVA41NKMeHFKCGeP-sVl0OrY-9xG-iGGgUZ00_5Lw/s1600/Screenshot+%2528181%2529+-+Copy.png" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Here ,I have a torrent "stopped" because I manually stopped it.</td></tr>
</tbody></table>
</li>
</ol>
<div>
By default , uTorrent will select the torrent you added first as it's top priority and the next it's second and so on. if you want to override a torrent's position to make it the top priority , then you'll have to move it up the list , or to reduce its priority, move it down the list.</div>
<div>
<br /></div>
<div>
<h2>
Changing Default Priorities</h2>
<div>
<br /></div>
<div>
<div class="separator" style="clear: both; text-align: left;">
</div>
<div class="separator" style="clear: both; text-align: center;">
</div>
<ol>
<li>Select the torrent ,whose priority you wish to change <a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiobpacOuytBxv8wmoqhfdullFRv_JUts4FeGu1t71kQ_jzAc91E380iTFHxU8IO7FYkpcohIl8uf5niM8ejsuUrgTgY_enaM-LdBoncxj109V9fWdrKUR_dbhxV_yYPsA9yMIHjHhOULw/s1600/Screenshot+%2528185%2529.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="133" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiobpacOuytBxv8wmoqhfdullFRv_JUts4FeGu1t71kQ_jzAc91E380iTFHxU8IO7FYkpcohIl8uf5niM8ejsuUrgTgY_enaM-LdBoncxj109V9fWdrKUR_dbhxV_yYPsA9yMIHjHhOULw/s320/Screenshot+%2528185%2529.png" width="320" /></a></li>
<li>Now move it up or down the list(Queue) by using the "move up queue" or "move down queue" buttons in the toolbar , they look like an upward arrow and a downward arrow respectively <div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhw-3sG1hLC46HIeCp4RPAl1Pxi3bZXouq6aDLUQtGq1tZnZQJ7t-ahQiHS6MqFEH-Dim7EG4E7JT0VrstXpHnnN5i61gNBOrs9Ji8oaPCCM65845LTOqxgg4b88zSF_7znw0NYvAbVk7A/s1600/Screenshot+%2528186%2529.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="127" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhw-3sG1hLC46HIeCp4RPAl1Pxi3bZXouq6aDLUQtGq1tZnZQJ7t-ahQiHS6MqFEH-Dim7EG4E7JT0VrstXpHnnN5i61gNBOrs9Ji8oaPCCM65845LTOqxgg4b88zSF_7znw0NYvAbVk7A/s320/Screenshot+%2528186%2529.png" width="320" /></a></div>
</li>
</ol>
<ul>
<li>Once you get all the torrents you have, downloading in the order of their priority , you can leave it unattended and it'll download sequentially,</li>
<li>The next time you add a new torrent it will be added to the bottom of this list,simply give it it's position in the queue by using the arrows and you're good to go.</li>
</ul>
</div>
</div>
</div>
Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-7273039283046031779.post-63996425838310297122015-07-05T01:25:00.003+05:302017-06-26T06:09:02.710+05:30Writing a python module to simulate a LCD So recently I got a Raspberry pi and a 16x2 character LCD screen , I thought ,<a href="http://gadget-geek-prashant.blogspot.com/2015/07/making-python-game-preparation-part-1.html" target="_blank"> lets make a simple game that can be played on the lcd</a>. my first instinct was to code directly for the lcd on the pi , but as I started coding I realized that the clutter of having the lcd connected wasn't really necessary while i am programming the game's logic .<br />
<br />
I decided to make a python module that gives me the lcd output on my monitor , this way i no longer need to work with my lcd connected and can even code the game on my laptop and test the results quickly . Moreover once im done with the coding , i can simply replace the module code , for the lcd control code , and my game is ready to deploy.<br />
<br />
The game shall have a post for itself, for now , lets focus on the module.<br />
<br />
Here's how to make a really simple python LCD simulator module.<br />
<ol>
<li>We begin by creating a folder , I shall name this folder "mlcd" (for mock lcd)</li>
<li>Then we create a python file called "__init__.py" </li>
<li>The "__init__.py" is the file where our module code is going to be.</li>
</ol>
so let us look at the code .<br />
<br />
<b>mlcd Module</b> :<br />
<div style="text-align: left;">
<ol>
<li>import pygame</li>
<li>def init(chars,lines):</li>
<li> global screen</li>
<li> global myfont</li>
<li> pygame.init()</li>
<li> size = [12*chars,20*lines]</li>
<li> screen= pygame.display.set_mode(size)</li>
<li> pygame.display.set_caption("Mock LCD")</li>
<li> myfont = pygame.font.SysFont("monospace", 20)</li>
<li><br />
</li>
<li>def draw(args):</li>
<li> i=0;</li>
<li> global screen</li>
<li> global myfont</li>
<li> screen.fill((0,0,0))#erase screen contents</li>
<li> while(i < len(args)):</li>
<li> line= myfont.render(args[i], 2, (255,255,0))</li>
<li> screen.blit(line, (0, 20*i))</li>
<li> i+=1</li>
<li> pygame.display.flip()</li>
</ol>
<div>
The module works by using pygame to render the output , and simply has 2 functions <br />
<ol>
<li> init(chars,lines)<br />
to initialize a display that is "chars" characters wide and "lines" lines in height<br />
this only needs to be run once.this code is designed to work with only one display<br />
,however should one require multiple displays , the module can be modified to use classes</li>
<li>draw(args)<br />
this is the function that draws the characters on to the screen , args is a python list (array)<br />
containing as many strings as there are lines . this function needs to be called again only if one wishes to update the output.</li>
</ol>
<div>
to include this module in your python project , simply copy the mlcd folder , into your working directory and import the module<br />
<br />
<b>Usage example</b>:<br />
<div>
<ol>
<li>import mlcd #import the module</li>
<li>mlcd.init(16,3) # initialize a 16x3 display</li>
<li>#draw the three lines passed as a list</li>
<li>mlcd.draw(["Hello", </li>
<li> " world",</li>
<li> "Mock LCD !!!"])</li>
</ol>
<div>
on running this script , we get the following output :<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj9b85485E7ZT4YmQrzaoc2dtbJ1sjBXioe-HUIedfPV0C2DyP2AQBgCpL5LDoCBmOETQBiMIWN7kTag82Za0eGrjC-gHByL6A2jiSTmahQ2ghgYP7YnPoUecx8VuW_Z2m6i8OdEAYnsB4/s1600/Screenshot+%2528173%2529.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj9b85485E7ZT4YmQrzaoc2dtbJ1sjBXioe-HUIedfPV0C2DyP2AQBgCpL5LDoCBmOETQBiMIWN7kTag82Za0eGrjC-gHByL6A2jiSTmahQ2ghgYP7YnPoUecx8VuW_Z2m6i8OdEAYnsB4/s1600/Screenshot+%2528173%2529.png" /></a></div>
<br />
<ul>
<li> Mono-space font is used because all characters must take equal amount of space on the screen , so changing the font might generate inaccurate results. </li>
<li>The color of text and fontsize can be changed , however the size of the window must also be adjusted in line 6 of the mlcd module.</li>
</ul>
</div>
</div>
<div>
<div style="text-align: center;">
<b><span style="font-size: large;"><a href="https://github.com/PrashantMohta/mlcd">Download the code from Github</a><br />and <a href="https://play.google.com/store/apps/developer?id=PrashantMohta" target="_blank"><br /></a></span></b><span style="font-size: large;"><a href="https://play.google.com/store/apps/developer?id=PrashantMohta" target="_blank">Checkout my games on the playstore</a> </span></div>
</div>
<br /></div>
</div>
</div>
Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-7273039283046031779.post-77503779270604145162015-07-04T02:28:00.001+05:302015-07-04T02:28:02.566+05:30Syncing the sound or the subtitles to the video <br /> Some times the sound or the subtitles on our videos just aren't properly synced with the video , basically they're either too early or too late , this takes away the entire fun from watching the Movie or the TV episode that we've waited for such a long time to watch..<br /><br />Thankfully, there's an easy fix if you're using VLC media player(other players might have the feature as well) , we've already spoken about how we can <a href="http://gadget-geek-prashant.blogspot.in/2015/07/download-subtitles-directly-from-within.html">download Subtitles easily using VLC media player</a> , so let's see how we can fix the track sync as well .<br /><br />
<ol>
<li>Open your video and click on tools in the menu bar at the top <div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiM-d7BHwFmXIBHlSaH1pcIilnUx2hXudCjx9CeoKFo577ZHXYL3CZN-kgBTdya1DYud-RyTys5gjAqw9Yl5gSIw_Mn4iqqt1DPadrLbnpuLyVoz3geUX7FO66iRmMiCsg-WZTzjw0aWqU/s1600/Screenshot+%2528168%2529.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="236" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiM-d7BHwFmXIBHlSaH1pcIilnUx2hXudCjx9CeoKFo577ZHXYL3CZN-kgBTdya1DYud-RyTys5gjAqw9Yl5gSIw_Mn4iqqt1DPadrLbnpuLyVoz3geUX7FO66iRmMiCsg-WZTzjw0aWqU/s400/Screenshot+%2528168%2529.png" width="400" /></a><br /></div>
</li>
<li><div class="separator" style="clear: both; text-align: left;">
Click on track synchronization , and you should see something like the picture below </div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgaNHsyhp_4MwX-3x0Wjnhp6kcpWqRnk0ATqw4EfXEevl-PXIDNyb09MOwdP7Wfjbpr2D4c_k-4qBecntwgiIwJrQVpwGTxtO9fey4F3leyU_MJwi8by8kTeQk8Ui_CoGbpTr7bpjTMb7o/s1600/Screenshot+%2528169%2529.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgaNHsyhp_4MwX-3x0Wjnhp6kcpWqRnk0ATqw4EfXEevl-PXIDNyb09MOwdP7Wfjbpr2D4c_k-4qBecntwgiIwJrQVpwGTxtO9fey4F3leyU_MJwi8by8kTeQk8Ui_CoGbpTr7bpjTMb7o/s320/Screenshot+%2528169%2529.png" width="310" /></a><br /></div>
</li>
<li><div class="separator" style="clear: both; text-align: left;">
Now , depending on which track you need to sync with the video , the subtitles or the audio , use the appropriate input boxes' arrows to sync the tracks , hitting the up arrow will cause the track to be delayed and hitting the down arrow will cause it to be hastened </div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiqKYQZSFcXAxHQS_fAdq2kmoJkpzAp9k1sVk8yYcSIGg3pMn7SHVsrX8EyYkEkChz11MYfnq9t_Vt_TvpUE6MXUCXrWElgjHOyuTAeAeK1lhVzNFMM6ZZE_eewTAZOBxZuy8m5j8lduhA/s1600/Screenshot+%2528170%2529.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiqKYQZSFcXAxHQS_fAdq2kmoJkpzAp9k1sVk8yYcSIGg3pMn7SHVsrX8EyYkEkChz11MYfnq9t_Vt_TvpUE6MXUCXrWElgjHOyuTAeAeK1lhVzNFMM6ZZE_eewTAZOBxZuy8m5j8lduhA/s1600/Screenshot+%2528170%2529.png" /></a><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgUupCfAzQk__3ndHm_LkfQNDIDYJuJuYc4F4GPqcm6hWAEIXSarU3tiNTNIQs-CRD4kSkar_IKYoZyYRrJHZa02iEEfWGGAWOwTPr3FEFFNoOq26ox5wBxxnrmXMVbobg1zfia3B9iOlg/s1600/Screenshot+%2528171%2529.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgUupCfAzQk__3ndHm_LkfQNDIDYJuJuYc4F4GPqcm6hWAEIXSarU3tiNTNIQs-CRD4kSkar_IKYoZyYRrJHZa02iEEfWGGAWOwTPr3FEFFNoOq26ox5wBxxnrmXMVbobg1zfia3B9iOlg/s1600/Screenshot+%2528171%2529.png" /></a></div>
</li>
<li><div class="separator" style="clear: both; text-align: left;">
Keep a close eye at the video to properly sync the track with the video,you may have to wait a moment after you alter the value, to see the result in the playback window.<br /></div>
</li>
<li><div class="separator" style="clear: both; text-align: left;">
Once you're happy with the sync , hit close and enjoy your Movie or Episode ....<br /></div>
</li>
</ol>
<div>
if the subtitles are not staying on the screen long enough or are staying on too long , you can try playing around with the subtitle speed and duration factor to find the correct values and don't worry , should you mess up , you can always click the reset button in the upper right of the synchronization tab (the two blue arrows), to reset the tracks.<br /><br /> </div>
<br />
<!-- End of adf.ly banner code -->Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-7273039283046031779.post-7657631729411581172015-07-04T01:52:00.000+05:302015-07-04T02:30:20.824+05:30Download Subtitles Directly From Within VLC media player <br />
<br />
You just downloaded that latest episode of your favorite TV show on torrent, but it doesn't have any subtitles, well you have 2 options , either google for the subtitles and then try to download the right subs or use VLC media player's plugin VLSub, I'll show you how.<br />
<br />
<ol>
<li>Open the video file and pause it , on the menu bar at the top click on view .<br /><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhyWx0yxkGspuQuMynpNkjQKLpa35T3Pyffok7HGBBwfdUumLN2ayhAt3LC0lQcAn6KpP8VsCrP4zEEaeIIEZIuCUUi_VUxoxuelTOHZkKRRF2_y4ABOn65k9YWrN1F6ruHQsDr7ZCUZ1Q/s1600/Screenshot+%2528159%2529.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em; text-align: center;"><img border="0" height="214" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhyWx0yxkGspuQuMynpNkjQKLpa35T3Pyffok7HGBBwfdUumLN2ayhAt3LC0lQcAn6KpP8VsCrP4zEEaeIIEZIuCUUi_VUxoxuelTOHZkKRRF2_y4ABOn65k9YWrN1F6ruHQsDr7ZCUZ1Q/s320/Screenshot+%2528159%2529.png" width="320" /></a></li>
<li>Hit "Download Subtitles" , you should see a dialog box like so <a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhwWr7cmy7BTD9u21PeeTFqd2BMSdELY5C-dVZMPiV3ZiKfgarJ-T5OfbVhr89PFBpTl-Ecww-oh9_lu66LuF0NaC7SPSWA59ddEYaVRFZsW5XhjBNkF3SSrFRtpJAUoGwtJBbEcHZC-Po/s1600/Screenshot+%2528161%2529.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em; text-align: center;"><img border="0" height="317" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhwWr7cmy7BTD9u21PeeTFqd2BMSdELY5C-dVZMPiV3ZiKfgarJ-T5OfbVhr89PFBpTl-Ecww-oh9_lu66LuF0NaC7SPSWA59ddEYaVRFZsW5XhjBNkF3SSrFRtpJAUoGwtJBbEcHZC-Po/s320/Screenshot+%2528161%2529.png" width="320" /></a></li>
<li>Okay , now all you need to do is search for the subs , there are two options here , "search by hash" and "search by name" , usually a search by hash will get you subs that are properly synced , but if that doesn't work , simply search by name and then <a href="http://gadget-geek-prashant.blogspot.in/2015/07/syncing-sound-or-subtitles-to-video.html">correct the sync yourself</a> (if it isn't already proper.)<br />once the search is complete you should see a list of subs like this<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjLBTs7gQRrKtOUDneqWrqUeAx0RnRlq3dMGWiPVs9OGl-6M8XWwUWTVCJ2_ejp7anvt8fSBv-UYiBKy8blRXlq7shnRvwyugEpA3n9lS7E6anegPi7_YufziQbijOD6ouR32gg6FhD5ZE/s1600/Screenshot+%2528164%2529.png" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" height="290" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjLBTs7gQRrKtOUDneqWrqUeAx0RnRlq3dMGWiPVs9OGl-6M8XWwUWTVCJ2_ejp7anvt8fSBv-UYiBKy8blRXlq7shnRvwyugEpA3n9lS7E6anegPi7_YufziQbijOD6ouR32gg6FhD5ZE/s320/Screenshot+%2528164%2529.png" width="320" /></a></div>
</li>
<li><div class="separator" style="clear: both; text-align: left;">
Now just select a subtitle file and hit download , that's it ,enjoy your subs! </div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjkmgaepW2ERWZNkzSYrsZYlfzkHLNxzHdY7NFxD1yLVjqr7c2c3u9_ybab55Sbh1IlfNap81YROWGoSSGo4XzKXCa_RRJUgRGLAIJEPTQrlTPMRZwZWJQ2ZoCGs9cHjw8qgcsxksZm5n0/s1600/Screenshot+%2528165%2529.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="176" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjkmgaepW2ERWZNkzSYrsZYlfzkHLNxzHdY7NFxD1yLVjqr7c2c3u9_ybab55Sbh1IlfNap81YROWGoSSGo4XzKXCa_RRJUgRGLAIJEPTQrlTPMRZwZWJQ2ZoCGs9cHjw8qgcsxksZm5n0/s200/Screenshot+%2528165%2529.png" width="200" /></a><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj8J5z1MK05IZjswnqcAjW65qxcVDrtm1tBCZU1ckwFd0tqfo2HO-vlkg4cHIaU6EzYi5mTjV-eRfL9Ym-WQAbe72cGU_i8eFRPjNboxugz8byA9Mx6TfXLylPo0UkUyhahiAhm52yGBHs/s1600/Screenshot+%2528167%2529.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="155" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj8J5z1MK05IZjswnqcAjW65qxcVDrtm1tBCZU1ckwFd0tqfo2HO-vlkg4cHIaU6EzYi5mTjV-eRfL9Ym-WQAbe72cGU_i8eFRPjNboxugz8byA9Mx6TfXLylPo0UkUyhahiAhm52yGBHs/s200/Screenshot+%2528167%2529.png" width="200" /></a></div>
</li>
</ol>
<div style="text-align: left;">
The subs are downloaded and stored in the same folder as the video file , so this only needs to be done once. also u need atleast VLC media player 2.2 for VLSub to work ...<br />
<br />
should u encounter any other issues , or if VLSub isnt installed by default , please check the <a href="http://addons.videolan.org/content/show.php/VLSub+0.9.13?content=148752">VLSub plugin page</a></div>
Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-7273039283046031779.post-28053467158989690102015-05-05T14:34:00.000+05:302015-05-05T14:34:40.508+05:30Best of Logg | Coming back soon<div class="separator" style="clear: both; text-align: center;">
</div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiXy0WQctYZW5Z-8-KSwqGCnNwFIqMN1rBx9zeR33xHUUPRbURT_SrRVgcek9yCSalGmQOSqdCrNKVsQcZ4Zeh-ITkirMDUP1H8xurFvn-6WnONfCRhp_7_a7gXm-OZ0evpQXxyQ20N7EM/s1600/original.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="180" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiXy0WQctYZW5Z-8-KSwqGCnNwFIqMN1rBx9zeR33xHUUPRbURT_SrRVgcek9yCSalGmQOSqdCrNKVsQcZ4Zeh-ITkirMDUP1H8xurFvn-6WnONfCRhp_7_a7gXm-OZ0evpQXxyQ20N7EM/s320/original.jpg" width="320" /></a></div>
<br />Hey guys , I know I've been very inactive and that's because i hardly got any time from my college and studies but as more and more time passes i miss the blog more and more , so I've decided to start posting again , and what better way to kick that off , than with a list of the best and the handiest tips I've shared.<br />
<div style="text-align: left;">
<br /></div>
<div style="text-align: left;">
1.<a href="http://gadget-geek-prashant.blogspot.in/2012/10/undelete-filesbring-back-my-stuff.html" target="_blank">Recovering Deleted files </a> </div>
<div style="text-align: left;">
2.Google Chrome </div>
<ul>
<li style="text-align: left;"><a href="http://gadget-geek-prashant.blogspot.in/2013/06/making-new-userprofile-in-google-chrome.html#.VUiFqCGqqko">Make another profile</a></li>
<li style="text-align: left;"><a href="http://gadget-geek-prashant.blogspot.in/2012/12/save-all-open-tabs.html#.VUiFoyGqqkp">Save all open tabs</a></li>
<li><div style="text-align: left;">
<a href="http://gadget-geek-prashant.blogspot.in/2013/02/tech-trivia-reopen-closed-tab.html#.VUiFqSGqqko">Reopen Closed tab (without checking history)</a></div>
<div style="text-align: left;">
<br /></div>
</li>
</ul>
<div style="text-align: left;">
3.<a href="http://gadget-geek-prashant.blogspot.in/2012/10/reinstall-windows-painlessly.html">Reinstall windows silently</a><br /><br /><blockquote class="tr_bq">
I will be back soon , with much more content. keep checking this space :)</blockquote>
</div>
<br />
<!-- End of adf.ly banner code -->Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-7273039283046031779.post-47626061276774571552013-06-24T17:30:00.002+05:302013-06-24T17:31:45.566+05:30Making a new user/profile in Google chrome <div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgE2kIHLoxEpX3pMNdtWhP4NZl8FbpAxoy3UNAbmomfJEbV1zqd0wqk-GcURoLaU3gReF6spHk8ajKgKhPKwSUKhPtlY5b7udesfvg7R8P91abD9geU-Kx9tvTiKA8m_LaTCPItXTiiOwc/s1600/Screenshot+%2528115%2529.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgE2kIHLoxEpX3pMNdtWhP4NZl8FbpAxoy3UNAbmomfJEbV1zqd0wqk-GcURoLaU3gReF6spHk8ajKgKhPKwSUKhPtlY5b7udesfvg7R8P91abD9geU-Kx9tvTiKA8m_LaTCPItXTiiOwc/s1600/Screenshot+%2528115%2529.png" height="273" width="320"></a></div>
<div class="" style="clear: both; text-align: left;">
</div>
<div class="" style="clear: both; text-align: left;">
So there are times when you wanna use two Facebook accounts , or maybe separate your "work" internet history , from your "personal" internet history . maybe you want a different set of extensions active at different times . solution ? make a new (or multiple if you prefer) <a href="http://gadget-geek-prashant.blogspot.com/2012/10/first-install-applications-for-windows.html" target="_blank">Google chrome</a> profile , with different browser cookies , history files , bookmarks etc. let's get on with it ! </div>
<div class="separator" style="clear: both; text-align: center;">
<br></div>
<div class="separator" style="clear: both; text-align: center;">
</div>
<a href="https://gadget-geek-prashant.blogspot.com/2013/06/making-new-userprofile-in-google-chrome.html#more">Click here to read full post »</a>Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-7273039283046031779.post-8896906525417123522013-03-19T12:45:00.001+05:302013-03-19T12:45:57.219+05:30Robot that can make and launch paper planes ! <a href="http://imageshack.us/photo/my-images/534/3dbild.png/" target="_blank" title="ImageShack - Image And Video Hosting"><img border="0" src="http://img534.imageshack.us/img534/7631/3dbild.png"></a><br>
<i><span style="font-size: x-small;">Uploaded with <a href="http://imageshack.us/" target="_blank">ImageShack.us</a></span></i><br>
<br>
<a href="https://gadget-geek-prashant.blogspot.com/2013/03/robot-that-can-make-and-launch-paper.html#more">Click here to read full post »</a>Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-7273039283046031779.post-85155660527988949392013-03-12T16:02:00.001+05:302013-03-12T16:02:40.002+05:30How to check your internet speeds? - Techtrivia<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh_BLpqTkTdeo8wETVdB_U6FN1M1QpFHquTOoDlP7GvZgWo9KPgmdK8SDE_EADGe3TJ18PLQMfZdmHwEGpJlq8SO4-HfwmRdClkcEQ8mbpD2ZRY0Askskqv3wsKMF97z8sqnbk1R-PV1QE/s1600/internetspeed+tt.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="427" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh_BLpqTkTdeo8wETVdB_U6FN1M1QpFHquTOoDlP7GvZgWo9KPgmdK8SDE_EADGe3TJ18PLQMfZdmHwEGpJlq8SO4-HfwmRdClkcEQ8mbpD2ZRY0Askskqv3wsKMF97z8sqnbk1R-PV1QE/s640/internetspeed+tt.png" width="640" /></a></div>
<div style="text-align: center;">
<span style="font-size: large;"><br />So Do you wanna check your internet connection speed ? </span></div>
<span style="font-size: large;"><div style="text-align: center;">
Wanna check if your ISP is providing the best service ? ! </div>
<br /><b>First of all close all other programs and tabs in your browser !</b></span> not doing this gives inaccurate results<br /><div>
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhMqxBV9x7w5wJWkAzBVa_4GMjzCqrqSBT-Nfce5SL8HEbxxU8vHcgQoH0wL-rS2UyaiS-yfjmgZMhOWTwGOFBrRTPSG1BqaIVuQkKfnbQcoth4szVET5-orL-p-iU2iHVUU1E3Hsk2OZE/s1600/sd.png" imageanchor="1" style="clear: right; float: right; margin-bottom: 1em; margin-left: 1em;"><img border="0" height="176" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhMqxBV9x7w5wJWkAzBVa_4GMjzCqrqSBT-Nfce5SL8HEbxxU8vHcgQoH0wL-rS2UyaiS-yfjmgZMhOWTwGOFBrRTPSG1BqaIVuQkKfnbQcoth4szVET5-orL-p-iU2iHVUU1E3Hsk2OZE/s320/sd.png" width="320" /></a><span style="color: #0000ee;"><u><br /></u></span></div>
<ol>
<li><span style="font-size: large;">Open <a href="http://adf.ly/KhgWe">speedtest.net</a></span></li>
<li><span style="font-size: large;">Click begin test </span></li>
<li><span style="font-size: large;">Sit back and wait for the results </span></li>
<li><span style="font-size: large;">And.... you're done !</span></li>
</ol>
<br />
<br /><br />if you want to read up more on this topic you can always ask Me in the Comments or Google :)
<br />
that's it for now ,
<a href="https://twitter.com/PrashantM911">Tweets by @PrashantM911</a>
<a href="http://www.facebook.com/pages/Life-of-a-gadget-geek/233899886629635" target="_blank">like us on facebook</a> , comment and share !
<!-- Start of adf.ly banner code -->
<a href="http://adf.ly/?id=2227960"><img border="0" height="19" src="http://cdn.adf.ly/images/banners/adfly.350x19.1.png" title="AdF.ly - shorten links and earn money!" width="350" /></a>
<!-- End of adf.ly banner code -->Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-7273039283046031779.post-28489037474818443812013-03-07T13:37:00.001+05:302013-03-07T13:38:57.041+05:30Type in hindi , on android devices ......<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgVarjGX4paBDEx-d75ZIxBZKGgTG3RhZhRyUrB940IMvTRWHm68Lbyx-CmA1rSrBw4ZcAGG5TqKs8OctK_jo8kHempId9EGABTgff5rq_iVYgxertLAASOmPg0FqaVVi5aYRbMf-jGuT0/s1600/Screenshot+(64).png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="195" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgVarjGX4paBDEx-d75ZIxBZKGgTG3RhZhRyUrB940IMvTRWHm68Lbyx-CmA1rSrBw4ZcAGG5TqKs8OctK_jo8kHempId9EGABTgff5rq_iVYgxertLAASOmPg0FqaVVi5aYRbMf-jGuT0/s400/Screenshot+(64).png" width="400"></a></div>
<br>
<br>
<h3>
<span style="font-weight: normal;"><span style="font-size: small;"> Typing in Hindi just got easier on android devices , with Google releasing it's Hindi transliteration keyboard "<a href="https://play.google.com/store/apps/details?id=com.google.android.apps.inputmethod.hindi" rel="nofollow" target="_blank">Google Hindi Input</a> " , It allows you to type messages, update on social networks or compose emails in Hindi on your Android phone !</span></span><br>
<span style="font-weight: normal;"><span style="font-size: small;"></span></span></h3><a href="https://gadget-geek-prashant.blogspot.com/2013/03/type-in-hindi-on-android-devices.html#more">Click here to read full post »</a>Unknownnoreply@blogger.com3tag:blogger.com,1999:blog-7273039283046031779.post-52160697938539656832013-02-23T18:10:00.003+05:302013-02-23T18:16:27.469+05:30Facebook Flaw allows complete control over your account ! <div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhwEmEDdqu29lww1fOZcCywQHBBDfEiRfQ0teQ47nSafCF-wbHo3bi25TwcMr9d9l0Nb8fhmDiFi3QSNo_P1pA0HeQ8aYg68xqXD4rHTA5SzCMcCuSG9vy03t2qnONLJbAsaEgB3cyDiCg/s1600/Facebook%252BSecurity%252BSettings%255B1%255D.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="265" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhwEmEDdqu29lww1fOZcCywQHBBDfEiRfQ0teQ47nSafCF-wbHo3bi25TwcMr9d9l0Nb8fhmDiFi3QSNo_P1pA0HeQ8aYg68xqXD4rHTA5SzCMcCuSG9vy03t2qnONLJbAsaEgB3cyDiCg/s400/Facebook%252BSecurity%252BSettings%255B1%255D.jpg" width="400" /></a></div>
<br />
To many people , their Facebook account is a major part of their online presence , if not the only one . People share boatloads of their lives on this social network and interact with all their friends and family through it , Facebook is practically the whole internet for quite a few people , and as such there are <a href="http://gadget-geek-prashant.blogspot.in/2012/10/facebook-security-real-or-virtual.html#.USgN9B2VN34" target="_blank">a lot of privacy concerns on the social network.</a><br />
<br />
By using Facebook's API even third party web developers can get access to a very large audience ,and many apps do post spam and irrelevant things via their user's profile , all in an attempt to get more users to use their app , thankfully , there is a permission system whereby <a href="http://gadget-geek-prashant.blogspot.in/2013/02/how-to-avoid-spreading-facebook-spam.html#.USgN4x2VN34" target="_blank">you can disallow an app to post things</a> that, you do not want to share .<br />
<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiLRsJi3JyShgGAhYWCY0wE_XB3foifa4NGPxv_8D-T4UTfViLXhxGCeVuHkCt9K_aUGpyq1DYwaeci2iAlESqfrVZSSqcCeSbLeo1ac1xuPovmhdpfFG6IZ0FPmOiy70JCnwuAAxaigBE/s1600/nadia+oauth+diamond+dash%5B1%5D.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" height="181" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiLRsJi3JyShgGAhYWCY0wE_XB3foifa4NGPxv_8D-T4UTfViLXhxGCeVuHkCt9K_aUGpyq1DYwaeci2iAlESqfrVZSSqcCeSbLeo1ac1xuPovmhdpfFG6IZ0FPmOiy70JCnwuAAxaigBE/s400/nadia+oauth+diamond+dash%5B1%5D.jpg" width="400" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;"><a href="http://www.nirgoldshlager.com/2013/02/how-i-hacked-facebook-oauth-to-get-full.html" target="_blank">Image credit</a></td></tr>
</tbody></table>
but ,it seems this security has it's flaws , <a class="g-profile" href="http://plus.google.com/103886841549847586349" target="_blank">+Nir Goldshlager</a> has found a security flaw in this technique of securing the users account that allows a third party to get complete access to your account,<br />
<br />
<blockquote class="tr_bq">
<div style="background-color: #f9f9f9; direction: ltr; margin: 0px; outline: 0px; padding: 0px;">
<div style="color: #333333; font-family: Arial, sans-serif; font-size: 13px; line-height: 20.796875px; text-align: center;">
<b style="font-size: x-large; margin: 0px; outline: 0px; padding: 0px;"><span style="font-family: arial, sans-serif; margin: 0px; outline: 0px; padding: 0px;"><i>I wanted something more powerful!,</i></span></b></div>
<div style="text-align: center;">
<span style="color: #333333; font-family: Arial, sans-serif; font-size: 13px; line-height: 20.796875px;"><i><br />
</i></span></div>
</div>
<div style="background-color: #f9f9f9; color: #333333; direction: ltr; font-family: Arial, sans-serif; font-size: 13px; line-height: 20.796875px; margin: 0px; outline: 0px; padding: 0px;">
</div>
<div style="background-color: #f9f9f9; color: #333333; direction: ltr; font-family: Arial, sans-serif; font-size: 13px; line-height: 20.796875px; margin: 0px; outline: 0px; padding: 0px; text-align: center;">
<span style="font-family: arial, sans-serif; margin: 0px; outline: 0px; padding: 0px;"><i>Something that will give me full permissions (read inbox, outbox, manage pages, manage ads,access to private photos, videos, etc.) on the victim's account without any installed application on the victim and make Facebook do the Goldshake ;),</i></span></div>
</blockquote>
<br />
The hack works by utilizing the fact that Facebook has it's own "apps" that use these API and are completely trusted , hence , you don't need to allow Facebook messenger permission but Ebuddy or Nimbuzz will ask you for them . by using this one simple fact Nir was able to employ his previous findings and get complete access to the users account , without the user ever clicking the "allow" button. for more check out the video below and <a href="http://www.nirgoldshlager.com/2013/02/how-i-hacked-facebook-oauth-to-get-full.html" target="_blank">Nir's post </a><br />
<br />
<iframe allowfullscreen="" frameborder="0" height="360" src="http://www.youtube.com/embed/UlF7TeRKzt0?feature=player_embedded" width="640"></iframe><br />
<br />
if you want to read up more on this topic you can always ask Me in the Comments or Google :) <br />
that's it for now , <a href="https://twitter.com/PrashantM911">Tweets by @PrashantM911</a> <a href="http://www.facebook.com/pages/Life-of-a-gadget-geek/233899886629635" target="_blank">like us on facebook</a> , comment and share ! <!-- Start of adf.ly banner code --> <a href="http://adf.ly/?id=2227960"><img border="0" height="19" src="http://cdn.adf.ly/images/banners/adfly.350x19.1.png" title="AdF.ly - shorten links and earn money!" width="350" /></a> <!-- End of adf.ly banner code -->Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-7273039283046031779.post-4650915372642011712013-02-18T18:55:00.002+05:302013-02-18T18:55:22.086+05:30tech trivia - post blue status on Facebook ! <div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjIh0Y1mUYvUH_j2AMUgs4lGeECFByvGVnIi-U2eg3qQ9asIhWv9o2BPabCzXeUb9WkFJnV9mCkwLwO1RzhRe-kKwi1fsvOZwCEI4N6iFqJud10GXNhXgsl1Uw8UvGHdKQvBRnaLOiJ0zc/s1600/Screenshot+%252860%2529.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="117" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjIh0Y1mUYvUH_j2AMUgs4lGeECFByvGVnIi-U2eg3qQ9asIhWv9o2BPabCzXeUb9WkFJnV9mCkwLwO1RzhRe-kKwi1fsvOZwCEI4N6iFqJud10GXNhXgsl1Uw8UvGHdKQvBRnaLOiJ0zc/s640/Screenshot+%252860%2529.png" width="640"></a></div>
<br>
Today i am going to show you how to post a status in blue color on Facebook .<br>
<br>
<br>
<a href="https://gadget-geek-prashant.blogspot.com/2013/02/tech-trivia-post-blue-status-on-facebook.html#more">Click here to read full post »</a>Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-7273039283046031779.post-48137995412887799472013-02-17T18:32:00.000+05:302013-02-17T18:32:16.218+05:30how to avoid spreading Facebook spam apps<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgzljjQp3K6cXm5KPb0adEHSzIC69ZTF_7Ktv_848zx8EBXF1UEOb9fObw9K9RHtOiqZSInPelAItgz75i3hVLdqaezzG_rN8e3cYzRFxrT_Nq0hcP-Jt4NiOrRQytE237AvNkAjSfcdko/s1600/spam%5B1%5D.gif" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgzljjQp3K6cXm5KPb0adEHSzIC69ZTF_7Ktv_848zx8EBXF1UEOb9fObw9K9RHtOiqZSInPelAItgz75i3hVLdqaezzG_rN8e3cYzRFxrT_Nq0hcP-Jt4NiOrRQytE237AvNkAjSfcdko/s320/spam%5B1%5D.gif" width="320" /></a></div>
<br />
<br />
There are many Facebook apps that post things on your behalf , but sometimes a few of these apps will post things regardless of the fact whether you want them to , or not , these types of apps generally come under the category of spamming apps , it is because people don't pay much attention before allowing an app the permission to post that these apps get the same , one simple way to ensure that an app does not post things is discussed here .<br />
<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhTFVH03cn0l-GUoH7eRaPmUqxCz2jgFXgIarqTSfjqUgNk9Ov_kDshN_eHQIRxXK6iL67KFDCemAjLBmCL4WRFGIBTkKOaliTvyRKDIbVBb1hjbm75mRploLzg20szvSuVq_hNnN9RrwI/s1600/Screenshot+(56).png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhTFVH03cn0l-GUoH7eRaPmUqxCz2jgFXgIarqTSfjqUgNk9Ov_kDshN_eHQIRxXK6iL67KFDCemAjLBmCL4WRFGIBTkKOaliTvyRKDIbVBb1hjbm75mRploLzg20szvSuVq_hNnN9RrwI/s1600/Screenshot+(56).png" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
on the app page simply select the option to make the posts to be visible only to you like the below image shows , this is also possible to do on the app permissions page ,</div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgSGSIuS5vlubFljXKmfnLl9iT6SDezqJsaTAjDOJAzB_rinBmv_zmQvKktAxROPRH4GFhVqE7rHVYCwNcpp8KOnoIhIYqFo8IZTkd7XzA7TZgqBG6bjm8PBq3zCInmqGrfVlq_c5y0s5o/s1600/Screenshot+(57).png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgSGSIuS5vlubFljXKmfnLl9iT6SDezqJsaTAjDOJAzB_rinBmv_zmQvKktAxROPRH4GFhVqE7rHVYCwNcpp8KOnoIhIYqFo8IZTkd7XzA7TZgqBG6bjm8PBq3zCInmqGrfVlq_c5y0s5o/s1600/Screenshot+(57).png" /></a></div>
once you have done this whenever that app posts any thing on your behalf it would look like this in your news feed ,<br />
<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjrcWg_gfoIgRz0ngnB1LmvrDi7-FOsXosB8DYCEVX95XsIbZTGWav9pEwp9ajq-lJ1RXnwPLKCuKA8uPAVsC1ekGI2EgJ-2u07Q0cVPJKSXq20Y5jrRvbuFUzMSiS4GoD4ARxKpNAmF5M/s1600/Screenshot+(59).png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjrcWg_gfoIgRz0ngnB1LmvrDi7-FOsXosB8DYCEVX95XsIbZTGWav9pEwp9ajq-lJ1RXnwPLKCuKA8uPAVsC1ekGI2EgJ-2u07Q0cVPJKSXq20Y5jrRvbuFUzMSiS4GoD4ARxKpNAmF5M/s1600/Screenshot+(59).png" /></a></div>
<h3>
<b><br /></b><b>Read More:</b></h3>
<div class="separator" style="clear: both; text-align: center;">
</div>
<ul>
<li style="text-align: left;"><a href="http://gadget-geek-prashant.blogspot.com/2013/02/how-to-make-successful-facebook-page.html">How to make successful facebook page</a></li>
<li style="text-align: left;"><a href="http://gadget-geek-prashant.blogspot.com/2013/01/analyzing-new-facebook-graph-search.html">Analyzing new facebook graph search</a></li>
</ul>
<br />
<br />
<br />
<br />
if you want to read up more on this topic you can always ask Me in the Comments or Google :)
<br />
that's it for now ,
<a href="https://twitter.com/PrashantM911">Tweets by @PrashantM911</a>
<a href="http://www.facebook.com/pages/Life-of-a-gadget-geek/233899886629635" target="_blank">like us on facebook</a> , comment and share !
<!-- Start of adf.ly banner code -->
<a href="http://adf.ly/?id=2227960"><img border="0" height="19" src="http://cdn.adf.ly/images/banners/adfly.350x19.1.png" title="AdF.ly - shorten links and earn money!" width="350" /></a>
<!-- End of adf.ly banner code -->Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-7273039283046031779.post-16939075582868208382013-02-17T13:15:00.000+05:302013-02-17T13:15:56.073+05:30tech trivia - reopen closed tab!<div class="separator" style="clear: both; text-align: left;">
if you accidentally closed a tab (or a few tabs) in your web browser , then you can re open them with a simple shortcut , </div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiWuE6iQ7qXlWK46XFel_75U20eoJ0QZgi4ntRAGMulojfVQEc0mDWypD4ksU-aXmJbREB6xzJPg5Wvhyphenhyphenrb0EMWjIa8cztdMRYYJ_QCy2-MXxSu2c1UZAmtxF4Oqz6-ntbdl5pIW88pcrU/s1600/35n40y.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="265" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiWuE6iQ7qXlWK46XFel_75U20eoJ0QZgi4ntRAGMulojfVQEc0mDWypD4ksU-aXmJbREB6xzJPg5Wvhyphenhyphenrb0EMWjIa8cztdMRYYJ_QCy2-MXxSu2c1UZAmtxF4Oqz6-ntbdl5pIW88pcrU/s400/35n40y.jpg" width="400" /></a></div>
<div style="text-align: center;">
<b><span style="font-size: x-large;">CTRL + SHIFT + T</span></b></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgkzx8CXQLBg6KnzTia888OMmcUrVpR2nrtttYqpJZIFz9UbYVsUlFrtkdIUR-C90E6pQc7o2xVwSszwMzQLF4kEiNswZO1M68K1pe7olQsJDiunS95JYgYogwQXbWZjPc1AvsxfRQqA_Q/s1600/qm.gif" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgkzx8CXQLBg6KnzTia888OMmcUrVpR2nrtttYqpJZIFz9UbYVsUlFrtkdIUR-C90E6pQc7o2xVwSszwMzQLF4kEiNswZO1M68K1pe7olQsJDiunS95JYgYogwQXbWZjPc1AvsxfRQqA_Q/s1600/qm.gif" /></a></div>
<i>this shortcut works in <a class="g-profile" href="http://plus.google.com/107964393728911462914" target="_blank">+Mozilla Firefox</a> as well as in <a class="g-profile" href="http://plus.google.com/100585555255542998765" target="_blank">+Google Chrome</a> </i><br />
<br />
for more Google chrome tab management tricks head over to the <a href="http://gadget-geek-prashant.blogspot.in/2012/10/google-chromes-tab-management-features.html#.UR_b5B2VN34" target="_blank">Chrome tab management post</a><br />
<div>
<br /></div>
if you want to read up more on this topic you can always ask Me in the Comments or Google :)
<br />
that's it for now ,
<a href="https://twitter.com/PrashantM911">Tweets by @PrashantM911</a> <a href="http://www.facebook.com/pages/Life-of-a-gadget-geek/233899886629635" target="_blank">like us on facebook</a> , comment and share !
<!-- Start of adf.ly banner code -->
<a href="http://adf.ly/?id=2227960"><img border="0" height="19" src="http://cdn.adf.ly/images/banners/adfly.350x19.1.png" title="AdF.ly - shorten links and earn money!" width="350" /></a>
<!-- End of adf.ly banner code -->Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-7273039283046031779.post-2519590075623927872013-02-07T11:40:00.000+05:302013-02-12T10:28:43.031+05:30The ultimate dryness formula ? Ultra-Ever Dry?<div class="separator" style="clear: both; text-align: center;">
</div>
<br>
<blockquote class="tr_bq" style="text-align: center;">
<i><b>Previously , I have talked about the <a href="http://gadget-geek-prashant.blogspot.com/2012/12/is-it-bike-is-it-helicopter-no-its.html" target="_blank">Hoverbike</a> , a bike that flies in the air</b></i> <i><b>and today I am going to talk about the<a href="https://www.youtube.com/watch?feature=player_embedded&v=IPM8OR6W6WE" target="_blank"> Ultra-Ever Dry</a> .</b></i></blockquote>
<br>
if you want some thing that can protect your stuff from getting wet or dirty ? , get this thing , it's called Ultra-Ever Dry , it's actually just a coating that can be applied to almost any material , the ones stated on their web site as ideal choices are steel, aluminum, other metals, plastic, leather, fabric, wood, concrete, etc.<br>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgZ3PxJk2Eh1TPOVX1BC4ULGLYnE3ppzCAz7WqgmIxxcKx437L-e5v5-6vcw_ybSetZi8YbJvKPXKMQ-4pkzNeHXQIhE0QZhqY3aieLDvKr8-1dczYbv4_1dI5TcsbSARckSb1pjrvIbz8/s1600/8267239389_5e88b8c089_z.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="400" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgZ3PxJk2Eh1TPOVX1BC4ULGLYnE3ppzCAz7WqgmIxxcKx437L-e5v5-6vcw_ybSetZi8YbJvKPXKMQ-4pkzNeHXQIhE0QZhqY3aieLDvKr8-1dczYbv4_1dI5TcsbSARckSb1pjrvIbz8/s400/8267239389_5e88b8c089_z.jpg" width="343"></a></div>
<div class="separator" style="clear: both; text-align: left;">
<span style="font-size: large;"></span></div>
<a href="https://gadget-geek-prashant.blogspot.com/2013/02/the-ultimate-dryness-formula-ultra-ever.html#more">Click here to read full post »</a>Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-7273039283046031779.post-43028712212306447052013-02-01T19:30:00.001+05:302013-02-01T19:30:25.185+05:30Techtrivia - task manager shortcut After years of using<b> ctrl + alt + del </b>to open task manager , since Windows Vista , Microsoft has changed the <b>ctrl + alt + del</b> shortcut to take you to a screen that gives you options similar to the one in the screenshot below .<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhz2rHa08mx4uh5rZ4WyouFV-FLRK3L7uy0gPHNkhuOEFfJAesFwsNMEcn0fAa6rnosQYF9JkBmzd1ubv09EmFOezs_slP6Q_MWDA-OTp6xqGZmGJT5Nxs32ZK1Q8E31vAPsW40cUdYO8Q/s1600/Screenshot+(54).png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhz2rHa08mx4uh5rZ4WyouFV-FLRK3L7uy0gPHNkhuOEFfJAesFwsNMEcn0fAa6rnosQYF9JkBmzd1ubv09EmFOezs_slP6Q_MWDA-OTp6xqGZmGJT5Nxs32ZK1Q8E31vAPsW40cUdYO8Q/s1600/Screenshot+(54).png" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
and you had to click on task manager if you wanted to open it , turns out that the actual shortcut for task manager now is<br />
<br />
<div style="text-align: center;">
<b><span style="font-family: Courier New, Courier, monospace; font-size: large;">ctrl + shift + esc </span></b></div>
<b><span style="font-family: Courier New, Courier, monospace; font-size: large;"><br /></span></b>
<span style="font-family: Arial, Helvetica, sans-serif;">which, by the way works in windows 8 as well .</span><br />
<span style="font-family: Arial, Helvetica, sans-serif;"><br /></span>
<span style="font-family: Arial, Helvetica, sans-serif;">thanks to <a href="https://plus.google.com/u/0/+RahulRoy/posts/Yi1kcys7uWj" target="_blank">this</a> post from <a class="g-profile" href="http://plus.google.com/109008933900993103361" target="_blank">+Rahul Roy</a> </span><br />
<br />
if you want to read up more on this topic you can always ask Me in the Comments or Google :)
<br />
that's it for now ,
<a href="https://twitter.com/PrashantM911">Tweets by @PrashantM911</a>, <a href="http://www.facebook.com/pages/Life-of-a-gadget-geek/233899886629635" target="_blank">like us on facebook</a> , follow on G+ <a class="g-profile" href="http://plus.google.com/114173783417394009183" target="_blank">+Prashant Mohta</a> <a href="http://adf.ly/?id=2227960"><img border="0" height="19" src="http://cdn.adf.ly/images/banners/adfly.350x19.1.png" title="AdF.ly - shorten links and earn money!" width="350" /></a>
<!-- End of adf.ly banner code -->Unknownnoreply@blogger.com0