<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:blogger='http://schemas.google.com/blogger/2008' xmlns:georss='http://www.georss.org/georss' xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-2686707142569253144</id><updated>2024-08-30T08:15:45.079-07:00</updated><category term="Blender 2012 Summer Game Competition"/><category term="Python"/><category term="Programming"/><category term="C++ and SDL_Net"/><category term="C++"/><category term="Game"/><category term="Make your own game"/><category term="Pygame"/><category term="3D/2D game development"/><category term="Game Idea&#39;s"/><category term="codeblocks"/><category term="game making"/><category term="MMORPG"/><category term="Python tutorial"/><category term="Server"/><category term="Ubuntu"/><category term="project"/><category term="rpg game"/><category term="simple game"/><category term="Android"/><category term="Android Games"/><category term="Create your own MMORPG"/><category term="Curiosity"/><category term="Funniest Meme"/><category term="Java cheatsheet"/><category term="Mars Rover"/><category term="OS"/><category term="Pointers"/><category term="SDL"/><category term="Web Development"/><category term="gmg"/><category term="java"/><category term="java tutorial"/><category term="landing time GMT"/><category term="linux"/><category term="proxy"/><category term="python socket"/><category term="rover landing"/><category term="software development"/><category term="the pirate bay"/><category term="tic tac toe"/><category term="unblock pirate bay"/><title type='text'>Game Makers Group Journal</title><subtitle type='html'></subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://gamemakersgroup.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2686707142569253144/posts/default?redirect=false'/><link rel='alternate' type='text/html' href='http://gamemakersgroup.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><link rel='next' type='application/atom+xml' href='http://www.blogger.com/feeds/2686707142569253144/posts/default?start-index=26&amp;max-results=25&amp;redirect=false'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>57</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-2686707142569253144.post-6139822434055871993</id><published>2013-05-27T19:45:00.000-07:00</published><updated>2013-05-27T19:45:30.512-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="3D/2D game development"/><category scheme="http://www.blogger.com/atom/ns#" term="Android"/><category scheme="http://www.blogger.com/atom/ns#" term="Android Games"/><category scheme="http://www.blogger.com/atom/ns#" term="Funniest Meme"/><category scheme="http://www.blogger.com/atom/ns#" term="MMORPG"/><category scheme="http://www.blogger.com/atom/ns#" term="Web Development"/><title type='text'>MMO, Android and Web Dev</title><content type='html'>&lt;h3&gt;
&lt;b&gt;Android&lt;/b&gt;&amp;nbsp;&lt;/h3&gt;
OK, so I started getting interested in developing for android for the past few months but never had the guts to actually start doing anything.&lt;br /&gt;
&lt;br /&gt;
Well for the past few weeks I put my head down and actually started learning quiet a lot. Even thought I am still working on starting the MMO project and I have a few exams coming up, I found time to fit it in.&lt;br /&gt;
&lt;br /&gt;
I am planning on creating a game this summer for the android market. I have a few idea&#39;s lined up but if they can&#39;t fit into the schedule, I would just have to recreate CowFall f Android. Sounds cool huh?..&lt;br /&gt;
&lt;br /&gt;
&lt;h3&gt;
MMO&lt;/h3&gt;
Anyway, developing the MMO is still on going. If you remember a few months ago or shall I say last summer, I started this project for an RPG that I was going to for the Blender Game Engine Summer Competition but came to a halt. Well I was thinking maybe just caring that on maybe since I found a book where I had most of the ideas for that game already.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;h3&gt;
Web&lt;/h3&gt;
&lt;br /&gt;
I have also been doing some web design and development. How do I have to time to do all this, I don&#39;t know, but I do. I have a lot of idea&#39;s lately but I am not going to get carried away and reveal them just yet as I might end up not doing them.&lt;br /&gt;
&lt;br /&gt;
About a week ago I did a weekend project where I created the site&amp;nbsp;&lt;a href=&quot;http://funniestmeme.com/&quot; target=&quot;_blank&quot;&gt;Funniest Meme&lt;/a&gt;. The site was just for fun and also just to test my ability to create a functional website. Bare in mind I did create this in just one weekend, it is still a good job.&lt;br /&gt;
&lt;br /&gt;
I am planning on creating another blog soon, maybe using WordPress that would revolve on more than just game making but I will let you know what is happening with that.</content><link rel='replies' type='application/atom+xml' href='http://gamemakersgroup.blogspot.com/feeds/6139822434055871993/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://gamemakersgroup.blogspot.com/2013/05/mmo-android-and-web-dev.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2686707142569253144/posts/default/6139822434055871993'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2686707142569253144/posts/default/6139822434055871993'/><link rel='alternate' type='text/html' href='http://gamemakersgroup.blogspot.com/2013/05/mmo-android-and-web-dev.html' title='MMO, Android and Web Dev'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2686707142569253144.post-3730907118725213683</id><published>2013-05-15T15:40:00.000-07:00</published><updated>2013-05-15T15:40:06.367-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="C++"/><category scheme="http://www.blogger.com/atom/ns#" term="C++ and SDL_Net"/><category scheme="http://www.blogger.com/atom/ns#" term="Create your own MMORPG"/><category scheme="http://www.blogger.com/atom/ns#" term="Game"/><category scheme="http://www.blogger.com/atom/ns#" term="Game Idea&#39;s"/><category scheme="http://www.blogger.com/atom/ns#" term="game making"/><category scheme="http://www.blogger.com/atom/ns#" term="Make your own game"/><category scheme="http://www.blogger.com/atom/ns#" term="MMORPG"/><category scheme="http://www.blogger.com/atom/ns#" term="Programming"/><category scheme="http://www.blogger.com/atom/ns#" term="Python"/><category scheme="http://www.blogger.com/atom/ns#" term="rpg game"/><title type='text'>Create your own MMORPG</title><content type='html'>I know I&#39;ve been saying this for a while now but I haven&#39;t got around to actually making a game yet.&lt;br /&gt;
&lt;br /&gt;
I am going to start planning on making an MMORPG from scratch and I&#39;m hoping to get an alpha version up by the end of this year. I have some basic Idea&#39;s of what the MMORPG is going to be like but for now I am planning the technical side of it.&lt;br /&gt;
&lt;br /&gt;
&lt;h3&gt;
Technical Side&lt;/h3&gt;
&lt;h4&gt;
Programming Languages&lt;/h4&gt;
&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;C++ - for programming the whole engine&lt;/li&gt;
&lt;li&gt;Lua or Python for scripting&lt;/li&gt;
&lt;/ul&gt;
&lt;br /&gt;
&lt;h4&gt;
Graphics Library&lt;/h4&gt;
&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;SDL - for all the windows handling and importing images/textures&lt;/li&gt;
&lt;li&gt;OpenGL - The game will be in 3D so everything will be rendered using OpenGL&lt;/li&gt;
&lt;li&gt;Blender - This will be used for modelling the 3D models and also creating animations&lt;/li&gt;
&lt;li&gt;GIMP+Inkscape - these will be used to create the Textures and UI&lt;/li&gt;
&lt;/ul&gt;
&lt;h4&gt;
Networking Library&lt;/h4&gt;
&lt;div&gt;
&lt;ul&gt;
&lt;li&gt;SDL_net - This will be used for all the networking&lt;/li&gt;
&lt;/ul&gt;
&lt;h4&gt;
Developing Environment&lt;/h4&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;ul&gt;
&lt;li&gt;Linux - I will be developing it on linux but will use a virtual machine running windows XP and 7 to make sure it works.&lt;/li&gt;
&lt;li&gt;Geany/vim - I will be writing my files either using Geany or vim.&lt;/li&gt;
&lt;li&gt;g++ - I will be using the GNU G++ compiler to compile the game&lt;/li&gt;
&lt;li&gt;make - I will use a make file to compile and link all the files&lt;/li&gt;
&lt;/ul&gt;
&lt;h4&gt;
Help&lt;/h4&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;ul&gt;
&lt;li&gt;Gamedev - To post on anything game programming related. networking, graphics or game logic&lt;/li&gt;
&lt;li&gt;Blender - To post about anything graphics related. Modelling, animation, texturing&lt;/li&gt;
&lt;li&gt;I will also look for forums on story telling, level making, colour schemes etc&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;
&lt;div&gt;
I will be going over everything I do and will document my progress.&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://gamemakersgroup.blogspot.com/feeds/3730907118725213683/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://gamemakersgroup.blogspot.com/2013/05/create-your-own-mmorpg.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2686707142569253144/posts/default/3730907118725213683'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2686707142569253144/posts/default/3730907118725213683'/><link rel='alternate' type='text/html' href='http://gamemakersgroup.blogspot.com/2013/05/create-your-own-mmorpg.html' title='Create your own MMORPG'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2686707142569253144.post-4557695254367394383</id><published>2013-03-10T17:33:00.002-07:00</published><updated>2013-03-10T17:33:52.599-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Game Idea&#39;s"/><category scheme="http://www.blogger.com/atom/ns#" term="game making"/><category scheme="http://www.blogger.com/atom/ns#" term="Pygame"/><category scheme="http://www.blogger.com/atom/ns#" term="Python"/><category scheme="http://www.blogger.com/atom/ns#" term="simple game"/><title type='text'>Asteroid Miner Pygame</title><content type='html'>Okay so today I was working on a prototype for an upcoming game that I am working on. This game is called Asteroid Miner. Basically it&#39;s like that gold miner game but you&#39;re mining asteroids.&lt;br /&gt;
&amp;nbsp;At the moment I am using place holders and not actual imagery and I haven&#39;t actually finished the game.&lt;br /&gt;
&lt;br /&gt;
In the finished game you will be able to get better grabbers and also the game speed will increase and you will be able to store high scores.&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhGLmjYn1uSbv4dzeCbqXkB0EKiop0tRR_1kYU2_U1E4iZoVxp4XJzl_UU0pDM-_YY-4mmp6X0mmRS8hWWEGsuh1vISJ3obdSVhI0e3A_kTYLJf5AAY5l8DARqP9Xw5L3DYODl_kjFuz8L0/s1600/astroid+miner.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;255&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhGLmjYn1uSbv4dzeCbqXkB0EKiop0tRR_1kYU2_U1E4iZoVxp4XJzl_UU0pDM-_YY-4mmp6X0mmRS8hWWEGsuh1vISJ3obdSVhI0e3A_kTYLJf5AAY5l8DARqP9Xw5L3DYODl_kjFuz8L0/s320/astroid+miner.png&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;</content><link rel='replies' type='application/atom+xml' href='http://gamemakersgroup.blogspot.com/feeds/4557695254367394383/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://gamemakersgroup.blogspot.com/2013/03/asteroid-miner-pygame.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2686707142569253144/posts/default/4557695254367394383'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2686707142569253144/posts/default/4557695254367394383'/><link rel='alternate' type='text/html' href='http://gamemakersgroup.blogspot.com/2013/03/asteroid-miner-pygame.html' title='Asteroid Miner Pygame'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhGLmjYn1uSbv4dzeCbqXkB0EKiop0tRR_1kYU2_U1E4iZoVxp4XJzl_UU0pDM-_YY-4mmp6X0mmRS8hWWEGsuh1vISJ3obdSVhI0e3A_kTYLJf5AAY5l8DARqP9Xw5L3DYODl_kjFuz8L0/s72-c/astroid+miner.png" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2686707142569253144.post-5606625432677679982</id><published>2013-03-06T10:33:00.003-08:00</published><updated>2013-03-06T10:39:37.253-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="game making"/><category scheme="http://www.blogger.com/atom/ns#" term="Pygame"/><category scheme="http://www.blogger.com/atom/ns#" term="Python"/><category scheme="http://www.blogger.com/atom/ns#" term="Python tutorial"/><category scheme="http://www.blogger.com/atom/ns#" term="rpg game"/><title type='text'>pygame map scrolling for RPG games</title><content type='html'>Okay so I am still messing around in pygame hoping to one day do a project which will be an RPG video game.&lt;br /&gt;
&lt;br /&gt;
I am now doing some tech demo&#39;s and today I thought about doing a simple scrolling map. this means that you can have a bigger map than your viewport and you can scroll to it when the player enters new places.&lt;br /&gt;
&lt;br /&gt;
This is a simple one and the next I will do will be a tilled based one with collision detection.&lt;br /&gt;
&lt;br /&gt;
Okay if you would like to follow the tutorial, you&#39;d need to create a big map, bigger than 640x480 pixels and save it next to your python file as bigmap.png&lt;br /&gt;
&lt;br /&gt;
(don&#39;t forget that statements starting with # are comments)&lt;br /&gt;
[THE CODE]
&lt;code&gt;&amp;nbsp;&lt;/code&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: monospace;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: monospace;&quot;&gt;&lt;b style=&quot;background-color: #cfe2f3;&quot;&gt;import pygame, sys&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;b style=&quot;background-color: #cfe2f3;&quot;&gt;&lt;span style=&quot;font-family: monospace;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: monospace;&quot;&gt;pygame.init()&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b style=&quot;background-color: #cfe2f3;&quot;&gt;&lt;span style=&quot;font-family: monospace;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: monospace;&quot;&gt;#make out screen 640X480&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: monospace;&quot;&gt;&lt;b style=&quot;background-color: #cfe2f3;&quot;&gt;screen = pygame.display.set_mode((640,480))&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;b style=&quot;background-color: #cfe2f3;&quot;&gt;&lt;span style=&quot;font-family: monospace;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: monospace;&quot;&gt;#this will be our map&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: monospace;&quot;&gt;&lt;b style=&quot;background-color: #cfe2f3;&quot;&gt;bigmap = pygame.image.load(&quot;bigmap.png&quot;)&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;b style=&quot;background-color: #cfe2f3;&quot;&gt;&lt;span style=&quot;font-family: monospace;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: monospace;&quot;&gt;#caption of the game&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: monospace;&quot;&gt;&lt;b style=&quot;background-color: #cfe2f3;&quot;&gt;pygame.display.set_caption(&quot;scrolling map testing&quot;)&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;b style=&quot;background-color: #cfe2f3;&quot;&gt;&lt;span style=&quot;font-family: monospace;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: monospace;&quot;&gt;#position of the player&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: monospace;&quot;&gt;&lt;b style=&quot;background-color: #cfe2f3;&quot;&gt;x,y= 500,500&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;b style=&quot;background-color: #cfe2f3;&quot;&gt;&lt;span style=&quot;font-family: monospace;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: monospace;&quot;&gt;#these value will be used as the start coordinates of the cam&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: monospace;&quot;&gt;&lt;b style=&quot;background-color: #cfe2f3;&quot;&gt;camx,camy = 0,0&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;b style=&quot;background-color: #cfe2f3;&quot;&gt;&lt;span style=&quot;font-family: monospace;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: monospace;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: monospace;&quot;&gt;def set_cam():&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: monospace;&quot;&gt;&lt;b style=&quot;background-color: #cfe2f3;&quot;&gt;&amp;nbsp; &amp;nbsp; global camx&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: monospace;&quot;&gt;&lt;b style=&quot;background-color: #cfe2f3;&quot;&gt;&amp;nbsp; &amp;nbsp; global camy&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;b style=&quot;background-color: #cfe2f3;&quot;&gt;&lt;span style=&quot;font-family: monospace;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; #this will allow the player to be in the center of the view&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: monospace;&quot;&gt;&lt;b style=&quot;background-color: #cfe2f3;&quot;&gt;&amp;nbsp; &amp;nbsp; camx = x - 640/2&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: monospace;&quot;&gt;&lt;b style=&quot;background-color: #cfe2f3;&quot;&gt;&amp;nbsp; &amp;nbsp; camy = y - 480/2&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;b style=&quot;background-color: #cfe2f3;&quot;&gt;&lt;span style=&quot;font-family: monospace;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; #make sure the map is still in view&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: monospace;&quot;&gt;&lt;b style=&quot;background-color: #cfe2f3;&quot;&gt;&amp;nbsp; &amp;nbsp; #and make sure we&#39;re not out of bound&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: monospace;&quot;&gt;&lt;b style=&quot;background-color: #cfe2f3;&quot;&gt;&amp;nbsp; &amp;nbsp; if camx &amp;lt; 0:&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: monospace;&quot;&gt;&lt;b style=&quot;background-color: #cfe2f3;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; camx = 0&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: monospace;&quot;&gt;&lt;b style=&quot;background-color: #cfe2f3;&quot;&gt;&amp;nbsp; &amp;nbsp; if camy &amp;lt; 0:&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: monospace;&quot;&gt;&lt;b style=&quot;background-color: #cfe2f3;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; camy = 0&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: monospace;&quot;&gt;&lt;b style=&quot;background-color: #cfe2f3;&quot;&gt;&amp;nbsp; &amp;nbsp; if camx &amp;gt; bigmap.get_width() - 640:&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: monospace;&quot;&gt;&lt;b style=&quot;background-color: #cfe2f3;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; camx = bigmap.get_width() - 640&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: monospace;&quot;&gt;&lt;b style=&quot;background-color: #cfe2f3;&quot;&gt;&amp;nbsp; &amp;nbsp; if camy &amp;gt; bigmap.get_height() - 480:&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: monospace;&quot;&gt;&lt;b style=&quot;background-color: #cfe2f3;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; camy = bigmap.get_height() - 480&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: monospace;&quot;&gt;&lt;b style=&quot;background-color: #cfe2f3;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: monospace;&quot;&gt;&lt;b style=&quot;background-color: #cfe2f3;&quot;&gt;while 1:&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: monospace;&quot;&gt;&lt;b style=&quot;background-color: #cfe2f3;&quot;&gt;&amp;nbsp; &amp;nbsp; #fill the screen in black&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: monospace;&quot;&gt;&lt;b style=&quot;background-color: #cfe2f3;&quot;&gt;&amp;nbsp; &amp;nbsp; screen.fill(pygame.Color(0,0,0))&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: monospace;&quot;&gt;&lt;b style=&quot;background-color: #cfe2f3;&quot;&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: monospace;&quot;&gt;&lt;b style=&quot;background-color: #cfe2f3;&quot;&gt;&amp;nbsp; &amp;nbsp; #position the play so it can be in camera view&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: monospace;&quot;&gt;&lt;b style=&quot;background-color: #cfe2f3;&quot;&gt;&amp;nbsp; &amp;nbsp; player = pygame.Rect(x-camx,y-camy,16,16)&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: monospace;&quot;&gt;&lt;b style=&quot;background-color: #cfe2f3;&quot;&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: monospace;&quot;&gt;&lt;b style=&quot;background-color: #cfe2f3;&quot;&gt;&amp;nbsp; &amp;nbsp; #position the camera&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: monospace;&quot;&gt;&lt;b style=&quot;background-color: #cfe2f3;&quot;&gt;&amp;nbsp; &amp;nbsp; set_cam()&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;b style=&quot;background-color: #cfe2f3;&quot;&gt;&lt;span style=&quot;font-family: monospace;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; #show only a small area of the whole map&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: monospace;&quot;&gt;&lt;b style=&quot;background-color: #cfe2f3;&quot;&gt;&amp;nbsp; &amp;nbsp; screen.blit(bigmap,(0,0),(camx,camy,640,480))&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;b style=&quot;background-color: #cfe2f3;&quot;&gt;&lt;span style=&quot;font-family: monospace;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; #draw the yello player&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: monospace;&quot;&gt;&lt;b style=&quot;background-color: #cfe2f3;&quot;&gt;&amp;nbsp; &amp;nbsp; pygame.draw.rect(screen,pygame.Color(255,255,0),player)&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: monospace;&quot;&gt;&lt;b style=&quot;background-color: #cfe2f3;&quot;&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;b style=&quot;background-color: #cfe2f3;&quot;&gt;&lt;span style=&quot;font-family: monospace;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: monospace;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; for event in pygame.event.get():&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: monospace;&quot;&gt;&lt;b style=&quot;background-color: #cfe2f3;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; #check if the user wants to exit&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: monospace;&quot;&gt;&lt;b style=&quot;background-color: #cfe2f3;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; if event.type == pygame.QUIT:&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: monospace;&quot;&gt;&lt;b style=&quot;background-color: #cfe2f3;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; pygame.quit() #quit pygame&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: monospace;&quot;&gt;&lt;b style=&quot;background-color: #cfe2f3;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; sys.exit() &amp;nbsp; &amp;nbsp; &amp;nbsp;#exit the game&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: monospace;&quot;&gt;&lt;b style=&quot;background-color: #cfe2f3;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: monospace;&quot;&gt;&lt;b style=&quot;background-color: #cfe2f3;&quot;&gt;&amp;nbsp; &amp;nbsp; key = pygame.key.get_pressed() #get every key pressed&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;b style=&quot;background-color: #cfe2f3;&quot;&gt;&lt;span style=&quot;font-family: monospace;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; #move our player&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: monospace;&quot;&gt;&lt;b style=&quot;background-color: #cfe2f3;&quot;&gt;&amp;nbsp; &amp;nbsp; if key[pygame.K_UP]:&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: monospace;&quot;&gt;&lt;b style=&quot;background-color: #cfe2f3;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; y = y -4&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: monospace;&quot;&gt;&lt;b style=&quot;background-color: #cfe2f3;&quot;&gt;&amp;nbsp; &amp;nbsp; if key[pygame.K_DOWN]:&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: monospace;&quot;&gt;&lt;b style=&quot;background-color: #cfe2f3;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; y = y +4&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: monospace;&quot;&gt;&lt;b style=&quot;background-color: #cfe2f3;&quot;&gt;&amp;nbsp; &amp;nbsp; if key[pygame.K_LEFT]:&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: monospace;&quot;&gt;&lt;b style=&quot;background-color: #cfe2f3;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; x = x -4&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: monospace;&quot;&gt;&lt;b style=&quot;background-color: #cfe2f3;&quot;&gt;&amp;nbsp; &amp;nbsp; if key[pygame.K_RIGHT]:&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: monospace;&quot;&gt;&lt;b style=&quot;background-color: #cfe2f3;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; x = x +4&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;b style=&quot;background-color: #cfe2f3;&quot;&gt;&lt;span style=&quot;font-family: monospace;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; #update the display&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: monospace;&quot;&gt;&lt;b style=&quot;background-color: #cfe2f3;&quot;&gt;&amp;nbsp; &amp;nbsp; pygame.display.update()&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://gamemakersgroup.blogspot.com/feeds/5606625432677679982/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://gamemakersgroup.blogspot.com/2013/03/pygame-map-scrolling-for-rpg-games.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2686707142569253144/posts/default/5606625432677679982'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2686707142569253144/posts/default/5606625432677679982'/><link rel='alternate' type='text/html' href='http://gamemakersgroup.blogspot.com/2013/03/pygame-map-scrolling-for-rpg-games.html' title='pygame map scrolling for RPG games'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2686707142569253144.post-1847548790745499709</id><published>2013-03-05T11:43:00.002-08:00</published><updated>2013-03-05T11:45:08.355-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Pygame"/><category scheme="http://www.blogger.com/atom/ns#" term="Python"/><category scheme="http://www.blogger.com/atom/ns#" term="simple game"/><title type='text'>pygame simple game </title><content type='html'>Okay yesterday I was watching a show and programming at the same time. I was messing around in python and pygame and I actually created something worth while. I will upload a screen shot.&lt;br /&gt;
&lt;br /&gt;
The red box is the player which has a label on its head so you can identify who it is and you can move the player using the arrow keys. the black rectangles and box are&amp;nbsp;obstacles, they are solid so they will stop the player. The yellow boxes are coins which you have to collect.&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhLRNpHI5S_mlKroMAHQbap6Mr-ZawTDMtz0JpzVwJvznshRltkLJawxPmqNQNs1h6w-ZY3VSVoYTM2i3_OOzR2TqGl_XSQs5AvyKG_G4qfgQk6U87xDujBcyIR0iDk6jnucFc47nGqzJI2/s1600/eat+me.png&quot; imageanchor=&quot;1&quot; style=&quot;clear: left; float: left; margin-bottom: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;255&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhLRNpHI5S_mlKroMAHQbap6Mr-ZawTDMtz0JpzVwJvznshRltkLJawxPmqNQNs1h6w-ZY3VSVoYTM2i3_OOzR2TqGl_XSQs5AvyKG_G4qfgQk6U87xDujBcyIR0iDk6jnucFc47nGqzJI2/s320/eat+me.png&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://gamemakersgroup.blogspot.com/feeds/1847548790745499709/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://gamemakersgroup.blogspot.com/2013/03/pygame-simple-game.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2686707142569253144/posts/default/1847548790745499709'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2686707142569253144/posts/default/1847548790745499709'/><link rel='alternate' type='text/html' href='http://gamemakersgroup.blogspot.com/2013/03/pygame-simple-game.html' title='pygame simple game '/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhLRNpHI5S_mlKroMAHQbap6Mr-ZawTDMtz0JpzVwJvznshRltkLJawxPmqNQNs1h6w-ZY3VSVoYTM2i3_OOzR2TqGl_XSQs5AvyKG_G4qfgQk6U87xDujBcyIR0iDk6jnucFc47nGqzJI2/s72-c/eat+me.png" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2686707142569253144.post-442681084097334486</id><published>2013-03-02T09:25:00.002-08:00</published><updated>2013-03-02T09:26:30.327-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Python"/><category scheme="http://www.blogger.com/atom/ns#" term="Python tutorial"/><title type='text'>Python tutorial [part 1]</title><content type='html'>&lt;br /&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
Getting started with Python&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoListParagraph&quot; style=&quot;margin-left: 18.0pt; mso-add-space: auto; mso-list: l0 level1 lfo1; text-indent: -18.0pt;&quot;&gt;
&lt;!--[if !supportLists]--&gt;1.&lt;span style=&quot;font-size: 7pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
&lt;/span&gt;&lt;!--[endif]--&gt;Installation&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;
&lt;div class=&quot;MsoListParagraph&quot; style=&quot;margin-left: 18.0pt; mso-add-space: auto; mso-list: l0 level1 lfo1; text-indent: -18.0pt;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
Go to the Python website and grab Python version 3.2 &lt;a href=&quot;http://www.python.org/getit/&quot;&gt;http://www.python.org/getit/&lt;/a&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
We will be working with version 3.2 since we will need for
pygame later on and at this point, pygame doesn’t work aswell on 3.3+&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
After you installed it we can now start creating python
programs.&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoListParagraph&quot; style=&quot;margin-left: 18.0pt; mso-add-space: auto; mso-list: l0 level1 lfo1; text-indent: -18.0pt;&quot;&gt;
&lt;!--[if !supportLists]--&gt;2.&lt;span style=&quot;font-size: 7pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
&lt;/span&gt;&lt;!--[endif]--&gt;“Hello Game Makers Group”&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;
&lt;div class=&quot;MsoListParagraph&quot; style=&quot;margin-left: 18.0pt; mso-add-space: auto; mso-list: l0 level1 lfo1; text-indent: -18.0pt;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
We can now start to do some programming in python. Our first
program will be a “hello world” type of program were it will print “Hello Game
Makers Group” to the console. &lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
Open up the IDLE which you can find in your programs menu
under python3.2. This will be our development environment.&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
Click on File then New Window and Save it as hello.py&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
Now in the new document you have just created, write:&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;background: #D6E3BC; mso-background-themecolor: accent3; mso-background-themetint: 102;&quot;&gt;
print(“Hello Game Makers Group”)&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
Now hit F5 or go to Run and then Run Module. There you have
it. You’re first program written in python.&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;
&lt;div class=&quot;MsoListParagraph&quot; style=&quot;margin-left: 18.0pt; mso-add-space: auto; mso-list: l0 level1 lfo1; text-indent: -18.0pt;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoListParagraph&quot; style=&quot;margin-left: 18.0pt; mso-add-space: auto; mso-list: l0 level1 lfo1; text-indent: -18.0pt;&quot;&gt;
&lt;!--[if !supportLists]--&gt;3.&lt;span style=&quot;font-size: 7pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
&lt;/span&gt;&lt;!--[endif]--&gt;Variables&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
Now I am going to show you how you can use variables in
python. &lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
When you create a variable in python, you don’t have to tell
it what the variable type is going to be and you can change it later on.&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;background: #D6E3BC; mso-background-themecolor: accent3; mso-background-themetint: 102;&quot;&gt;
N = 2&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;background: #D6E3BC; mso-background-themecolor: accent3; mso-background-themetint: 102;&quot;&gt;
&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;background: #D6E3BC; mso-background-themecolor: accent3; mso-background-themetint: 102;&quot;&gt;
C = ‘c’&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;background: #D6E3BC; mso-background-themecolor: accent3; mso-background-themetint: 102;&quot;&gt;
S = “Hello”&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
Let’s start off with strings. Strings are sequences of
characters.&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;background: #D6E3BC; mso-background-themecolor: accent3; mso-background-themetint: 102;&quot;&gt;
string1 = “This is a string”&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;background: #D6E3BC; mso-background-themecolor: accent3; mso-background-themetint: 102;&quot;&gt;
print(string1)&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
To print out the length of the string, you can do this:&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;background: #D6E3BC; mso-background-themecolor: accent3; mso-background-themetint: 102;&quot;&gt;
string1 = “This is a string”&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;background: #D6E3BC; mso-background-themecolor: accent3; mso-background-themetint: 102;&quot;&gt;
print(len(string1))&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
you can print out parts of the string by using the square
bracket.&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;background: #D6E3BC; mso-background-themecolor: accent3; mso-background-themetint: 102;&quot;&gt;
string1 = “This is a string”&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;background: #D6E3BC; mso-background-themecolor: accent3; mso-background-themetint: 102;&quot;&gt;
print(string[10:])&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
This will print everything after the tenth character which just
the word “string” if you put the colon before the 10, it will print out
everything up to the tenth character.&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoListParagraph&quot; style=&quot;margin-left: 18.0pt; mso-add-space: auto; mso-list: l0 level1 lfo1; text-indent: -18.0pt;&quot;&gt;
&lt;!--[if !supportLists]--&gt;4.&lt;span style=&quot;font-size: 7pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
&lt;/span&gt;&lt;!--[endif]--&gt;Comments&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;
&lt;div class=&quot;MsoListParagraph&quot; style=&quot;margin-left: 18.0pt; mso-add-space: auto; mso-list: l0 level1 lfo1; text-indent: -18.0pt;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
Comments in python are very easy. You start a comment by
using the # symbol and then write whatever. The comment ends at the end of the
line.&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;background: #D6E3BC; mso-background-themecolor: accent3; mso-background-themetint: 102;&quot;&gt;
String2 = “hello” &lt;b&gt;&lt;span style=&quot;color: #604a7b; mso-style-textfill-fill-alpha: 100.0%; mso-style-textfill-fill-color: #604A7B; mso-style-textfill-fill-colortransforms: lumm=75000; mso-style-textfill-fill-themecolor: accent4; mso-themecolor: accent4; mso-themeshade: 191;&quot;&gt;# This variable holds a string&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div class=&quot;MsoListParagraph&quot; style=&quot;margin-left: 18.0pt; mso-add-space: auto; mso-list: l0 level1 lfo1; text-indent: -18.0pt;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoListParagraph&quot; style=&quot;margin-left: 18.0pt; mso-add-space: auto; mso-list: l0 level1 lfo1; text-indent: -18.0pt;&quot;&gt;
&lt;!--[if !supportLists]--&gt;5.&lt;span style=&quot;font-size: 7pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
&lt;/span&gt;&lt;!--[endif]--&gt;Lists&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;
&lt;div class=&quot;MsoListParagraph&quot; style=&quot;margin-left: 18.0pt; mso-add-space: auto; mso-list: l0 level1 lfo1; text-indent: -18.0pt;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
One of the most useful things in python is lists.&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
You can declare a list by writing its name and using square
brackets to indicate it is a list. This is an empty list&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;background: #D6E3BC; mso-background-themecolor: accent3; mso-background-themetint: 102;&quot;&gt;
List1 = []&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
To declare a list with elements in it, you do the same thing
but with the elements in between the brackets.&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;background: #D6E3BC; mso-background-themecolor: accent3; mso-background-themetint: 102;&quot;&gt;
List1 = [12, 4, 32, 1, 2]&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
To print out the size of the list, you do the same thing you
did with the string variable and use the len function&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;background: #D6E3BC; mso-background-themecolor: accent3; mso-background-themetint: 102;&quot;&gt;
List1 = [12, 4, 32, 1, 2]&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;background: #D6E3BC; mso-background-themecolor: accent3; mso-background-themetint: 102;&quot;&gt;
Print(len(List1))&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
To access one of the elements in the list, you can use the
square bracket with the index value in it. The way the list is indexed is that
it starts with 0 for the first elements. So for a list with N elements, you can
access them using 0 to N-1.&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;background: #D6E3BC; mso-background-themecolor: accent3; mso-background-themetint: 102;&quot;&gt;
List1 = [12, 4, 32, 1, 2]&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;background: #D6E3BC; mso-background-themecolor: accent3; mso-background-themetint: 102;&quot;&gt;
Print(List1[0])&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
To add an item to a list, you can use the function append. And
the remove an item you use del.&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;background: #D6E3BC; mso-background-themecolor: accent3; mso-background-themetint: 102;&quot;&gt;
List1 = [12, 4, 32, 1, 2]&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;background: #D6E3BC; mso-background-themecolor: accent3; mso-background-themetint: 102;&quot;&gt;
Print(List1)&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;background: #D6E3BC; mso-background-themecolor: accent3; mso-background-themetint: 102;&quot;&gt;
List1.append(5&lt;span style=&quot;color: #604a7b; mso-style-textfill-fill-alpha: 100.0%; mso-style-textfill-fill-color: #604A7B; mso-style-textfill-fill-colortransforms: lumm=75000; mso-style-textfill-fill-themecolor: accent4; mso-themecolor: accent4; mso-themeshade: 191;&quot;&gt;) &lt;b&gt;#add the number 5 to the end of the list&lt;/b&gt;&lt;/span&gt;&lt;b&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;background: #D6E3BC; mso-background-themecolor: accent3; mso-background-themetint: 102;&quot;&gt;
print(List1)&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;background: #D6E3BC; mso-background-themecolor: accent3; mso-background-themetint: 102;&quot;&gt;
del List1[2] &lt;b&gt;&lt;span style=&quot;color: #604a7b; mso-style-textfill-fill-alpha: 100.0%; mso-style-textfill-fill-color: #604A7B; mso-style-textfill-fill-colortransforms: lumm=75000; mso-style-textfill-fill-themecolor: accent4; mso-themecolor: accent4; mso-themeshade: 191;&quot;&gt;# delete the 3&lt;sup&gt;rd&lt;/sup&gt;
element &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;background: #D6E3BC; mso-background-themecolor: accent3; mso-background-themetint: 102;&quot;&gt;
print(List1)&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;o:p&gt;&lt;br /&gt;&lt;/o:p&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
[End of part one of the python tutorial. In the next tutorial, I will go on a bit more on lists and I will go through the if and whiles loops and other control flow tools.]&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://gamemakersgroup.blogspot.com/feeds/442681084097334486/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://gamemakersgroup.blogspot.com/2013/03/python-tutorials-part-1.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2686707142569253144/posts/default/442681084097334486'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2686707142569253144/posts/default/442681084097334486'/><link rel='alternate' type='text/html' href='http://gamemakersgroup.blogspot.com/2013/03/python-tutorials-part-1.html' title='Python tutorial [part 1]'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2686707142569253144.post-2073373995706411399</id><published>2013-02-27T08:06:00.000-08:00</published><updated>2013-02-27T08:08:54.075-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Game"/><category scheme="http://www.blogger.com/atom/ns#" term="Make your own game"/><category scheme="http://www.blogger.com/atom/ns#" term="Programming"/><category scheme="http://www.blogger.com/atom/ns#" term="project"/><category scheme="http://www.blogger.com/atom/ns#" term="Pygame"/><category scheme="http://www.blogger.com/atom/ns#" term="Python"/><category scheme="http://www.blogger.com/atom/ns#" term="tic tac toe"/><title type='text'>Pygame Tic Tac Toe simple game</title><content type='html'>This is a second time I have created a tic tac toe game in python (third time if you include blender). This time I have used pygames and included graphical elements to it to make it more interesting.&lt;br /&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
The code is not documented so for someone who is a beginner in programming, pygame or python, you might get confused. This is not the finalized version so next time I will add comments to it but if you want to play around with it or change some stuff then feel free.&amp;nbsp;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
I hope someone could add a bit of AI to the computer because right now it is really dumb!&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
Have fun !&lt;br /&gt;
&lt;br /&gt;
--Edit--&lt;br /&gt;
Actually I think the aim of the game should be getting a tie with the computer LOL it is that stupid you can&#39;t even tie!&lt;br /&gt;
&lt;br /&gt;
~~~~~~~~~~~~~~~~~~~~~~~~~~The Code ~~~~~~~~~~~~~~~~~~~~~~~~~~~~&lt;br /&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;span style=&quot;font-family: monospace;&quot;&gt;import pygame, sys, random&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: monospace;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: monospace;&quot;&gt;pygame.init()&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: monospace;&quot;&gt;fpsClock = pygame.time.Clock()&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: monospace;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: monospace;&quot;&gt;screen = pygame.display.set_mode((640,480))&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: monospace;&quot;&gt;pygame.display.set_caption(&quot;Tic Tac Toe&quot;)&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: monospace;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: monospace;&quot;&gt;black = pygame.Color(0,0,0)&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: monospace;&quot;&gt;white = pygame.Color(255,255,255)&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: monospace;&quot;&gt;red = pygame.Color(255,0,0)&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: monospace;&quot;&gt;blue = pygame.Color(0,0,255)&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: monospace;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: monospace;&quot;&gt;font = pygame.font.Font(&quot;freesansbold.ttf&quot;,32)&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: monospace;&quot;&gt;smallfont = pygame.font.Font(&quot;freesansbold.ttf&quot;,16)&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: monospace;&quot;&gt;move = 0&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: monospace;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: monospace;&quot;&gt;thegrid = [0,0,0, 0,0,0, 0,0,0]&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: monospace;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: monospace;&quot;&gt;def grid():&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; pygame.draw.line(screen,black, (220,0),(220,480),4)&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; pygame.draw.line(screen,black, (420,0),(420,480),4)&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; pygame.draw.line(screen,black, (0,160),(640,160),4)&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; pygame.draw.line(screen,black, (0,320),(640,320),4)&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: monospace;&quot;&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: monospace;&quot;&gt;def cross(x,y, color):&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; pygame.draw.line(screen,color,(x+40,y+20),(x+160,y+140),2)&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; pygame.draw.line(screen, color,(x+40,y+140),(x+160,y+20),2)&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: monospace;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: monospace;&quot;&gt;def circle(x,y,color):&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; pygame.draw.circle(screen,color,(x+100,y+80),60,2)&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: monospace;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: monospace;&quot;&gt;def drawXO():&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; x = 0&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; y = 0&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; if(thegrid[0] == 1):&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; circle(0,0,red)&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; elif(thegrid[0] == 2):&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; cross(0,0,blue)&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: monospace;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; if(thegrid[1] == 1):&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; circle(220,0,red)&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; elif(thegrid[1] == 2):&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; cross(220,0,blue)&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; if(thegrid[2] == 1):&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; circle(420,0,red)&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; elif(thegrid[2] == 2):&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; cross(420,0,blue)&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: monospace;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; if(thegrid[3] == 1):&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; circle(0,160,red)&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; elif(thegrid[3] == 2):&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; cross(0,160,blue)&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: monospace;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; if(thegrid[4] == 1):&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; circle(220,160,red)&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; elif(thegrid[4] == 2):&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; cross(220,160,blue)&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: monospace;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; if(thegrid[5] == 1):&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; circle(420,160,red)&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; elif(thegrid[5] == 2):&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; cross(420,160,blue)&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: monospace;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; if(thegrid[6] == 1):&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; circle(0,320,red)&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; elif(thegrid[6] == 2):&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; cross(0,320,blue)&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: monospace;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; if(thegrid[7] == 1):&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; circle(220,320,red)&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; elif(thegrid[7] == 2):&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; cross(220,320,blue)&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; if(thegrid[8] == 1):&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; circle(420,320,red)&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; elif(thegrid[8] == 2):&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; cross(420,320,blue)&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: monospace;&quot;&gt;def usermove(mx,my):&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; global move&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; pos = 1&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; valid = False&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: monospace;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; if(mx &amp;lt;= 220 and my &amp;lt;= 160):&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; pos = 1&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; elif(mx &amp;gt;=220 and mx &amp;lt;= 420 and my &amp;lt;= 160):&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; pos = 2&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; elif(mx &amp;gt;= 420 and my &amp;lt;= 160):&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; pos = 3&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; elif(mx &amp;lt;=220 and my &amp;gt;= 160 and my &amp;lt;= 320):&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; pos = 4&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; elif(mx &amp;gt;= 220 and mx &amp;lt;= 420 and my &amp;gt;= 160 and my &amp;lt;= 320):&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; pos = 5&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; elif(mx &amp;gt;= 420 and my &amp;gt;= 160 and my &amp;lt;= 320):&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; pos = 6&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; elif(mx &amp;lt;= 220 and my &amp;gt;= 320):&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; pos = 7&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; elif(mx &amp;gt;= 220 and mx &amp;lt;= 420 and my &amp;gt;= 320):&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; pos = 8&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; elif(mx &amp;gt;= 420 and my &amp;gt;= 320):&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; pos = 9&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; else:&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; sys.exit()&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; if(thegrid[pos-1] == 0):&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; thegrid[pos-1] = 2&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; move =1&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; else:&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; pass&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: monospace;&quot;&gt;def commove():&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; global move&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; while(True):&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ran = random.random() * 100 %9&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ran = int(ran)&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; if(thegrid[ran] == 0):&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; thegrid[ran] = 1&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; move = 0&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; break&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: monospace;&quot;&gt;def winner():&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; global win&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; win = -1&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; mes = &quot;&quot;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; color = red&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: monospace;&quot;&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; if(thegrid[0] == thegrid[1] == thegrid[2] and thegrid[0] &amp;gt; 0):&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; win = thegrid[0]&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; elif(thegrid[0] == thegrid[4] == thegrid[8] and thegrid[0] &amp;gt; 0):&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; win = thegrid[0]&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; elif(thegrid[0] == thegrid[3] == thegrid[6] and thegrid[0] &amp;gt; 0):&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; win = thegrid[0]&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; elif(thegrid[3] == thegrid[4] == thegrid[5] and thegrid[3] &amp;gt; 0):&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; win = thegrid[3]&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; elif(thegrid[6] == thegrid[7] == thegrid[8] and thegrid[6] &amp;gt; 0):&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; win = thegrid[6]&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; elif(thegrid[6] == thegrid[4] == thegrid[2] and thegrid[6] &amp;gt; 0):&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; win = thegrid[6]&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; elif(thegrid[1] == thegrid[4] == thegrid[7] and thegrid[1] &amp;gt; 0):&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; win = thegrid[1]&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; elif(thegrid[2] == thegrid[5] == thegrid[8] and thegrid[2] &amp;gt; 0):&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; win = thegrid[2]&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; else:&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; if(not 0 in thegrid):&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; mes = &quot;It&#39;s a tie!&quot;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; color = black&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; move = 3&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; else:&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; return&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; move = 3&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; screen.fill(white)&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; if(win == 1):&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; mes = &quot;Computer has won&quot;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; color = red&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; elif(win == 2):&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; mes = &quot;Player has won&quot;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; color = blue&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; else:&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; pass&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; message = font.render(mes,0,color)&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; messagerect = message.get_rect()&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; messagerect.topleft = (40,240)&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; screen.blit(message,messagerect)&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; mes2 = &quot;Press &#39;r&#39; to play again&quot;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; message = smallfont.render(mes2,0,black)&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; messagerect = message.get_rect()&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; messagerect.topleft = (40,140)&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; screen.blit(message,messagerect)&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: monospace;&quot;&gt;while(1):&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; screen.fill(white)&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; grid()&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; drawXO()&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; mx = 0&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; my = 0&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: monospace;&quot;&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; if(move == 1):&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; commove()&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: monospace;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; for event in pygame.event.get():&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; if event.type == pygame.QUIT:&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; pygame.quit()&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; elif event.type == pygame.MOUSEBUTTONUP:&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; mx, my = event.pos&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; if(move == 0):&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; usermove(mx, my)&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; elif event.type == pygame.KEYDOWN:&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; if event.key == pygame.K_r:&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; for x in range(0,9):&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; thegrid[x] = 0&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; move = 0&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; if(not 0 in thegrid):&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; move = 3&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; winner()&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: monospace;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; #pygame.display.update()&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; pygame.display.flip()&lt;/span&gt;&lt;br /&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://gamemakersgroup.blogspot.com/feeds/2073373995706411399/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://gamemakersgroup.blogspot.com/2013/02/pygame-tic-tac-toe-simple-game.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2686707142569253144/posts/default/2073373995706411399'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2686707142569253144/posts/default/2073373995706411399'/><link rel='alternate' type='text/html' href='http://gamemakersgroup.blogspot.com/2013/02/pygame-tic-tac-toe-simple-game.html' title='Pygame Tic Tac Toe simple game'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2686707142569253144.post-3896551249425552937</id><published>2013-01-22T14:40:00.000-08:00</published><updated>2013-01-22T14:40:10.099-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="java"/><category scheme="http://www.blogger.com/atom/ns#" term="Java cheatsheet"/><category scheme="http://www.blogger.com/atom/ns#" term="java tutorial"/><category scheme="http://www.blogger.com/atom/ns#" term="Programming"/><title type='text'>Java Cheatsheet !!</title><content type='html'>Okay I know on these blogs I talk about a lot of different programming languages, well some may not think it&#39;s a lot but it&#39;s a fair few.&lt;br /&gt;
&lt;br /&gt;
Well I&#39;ve been using java for a few months now and sometimes changing between the languages can be exhausting and sometimes you forget the syntax or forget some keywords or structure so I made a java cheatsheet if you like.&lt;br /&gt;
&lt;br /&gt;
This cheatsheet or a mini cheat book has quiet a lot of info in it and I think it will be useful and easy to read through than going to the documentation and looking all over the place to find what you&#39;re looking for.&lt;br /&gt;
&lt;br /&gt;
Anyway this is a first draft and I will make sure I will update it soon to java cheatsheet 2 or something and add more to it and clear some stuff from it also.&lt;br /&gt;
&lt;br /&gt;
Hope someone finds it helpful, especially if you&#39;re new to java&lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;http://gamemakergroup.webs.com/java%20cheatsheet%20.pdf&quot; target=&quot;_blank&quot;&gt;Java Cheatsheet&lt;/a&gt;</content><link rel='replies' type='application/atom+xml' href='http://gamemakersgroup.blogspot.com/feeds/3896551249425552937/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://gamemakersgroup.blogspot.com/2013/01/java-cheatsheet.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2686707142569253144/posts/default/3896551249425552937'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2686707142569253144/posts/default/3896551249425552937'/><link rel='alternate' type='text/html' href='http://gamemakersgroup.blogspot.com/2013/01/java-cheatsheet.html' title='Java Cheatsheet !!'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2686707142569253144.post-2828319367692460267</id><published>2013-01-17T14:51:00.001-08:00</published><updated>2013-01-17T14:51:37.448-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="project"/><category scheme="http://www.blogger.com/atom/ns#" term="software development"/><title type='text'>Project Project</title><content type='html'>I really want to work on a project, any project I guess.&lt;br /&gt;
&lt;br /&gt;
I can&#39;t keep myself motivated to finish anything so I was looking around on source forge and thought maybe I could work on on some project in there. It will be good learning curve for me and also I could be &amp;nbsp;part of a project that wouldn&#39;t actually stop.&lt;br /&gt;
&lt;br /&gt;
First I looked at some modelling and 3D animation software like K3D and wing but I&#39;m not sure about their development. I could create some scripts or something but I&#39;m still thinking about it.&lt;br /&gt;
&lt;br /&gt;
I thought about going back to blender and maybe creating templates and script add-on or learn the architecture and start developing for them.&lt;br /&gt;
&lt;br /&gt;
Who know.. I will update if anything comes up.</content><link rel='replies' type='application/atom+xml' href='http://gamemakersgroup.blogspot.com/feeds/2828319367692460267/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://gamemakersgroup.blogspot.com/2013/01/project-project.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2686707142569253144/posts/default/2828319367692460267'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2686707142569253144/posts/default/2828319367692460267'/><link rel='alternate' type='text/html' href='http://gamemakersgroup.blogspot.com/2013/01/project-project.html' title='Project Project'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2686707142569253144.post-8740688404471263479</id><published>2013-01-09T12:38:00.001-08:00</published><updated>2013-01-09T12:38:34.368-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="linux"/><category scheme="http://www.blogger.com/atom/ns#" term="OS"/><title type='text'>fresh start *sigh*</title><content type='html'>I hate having to re-install all the software and libraries and everything else I need every time I install a fresh OS.&lt;br /&gt;
&lt;br /&gt;
Recently I&amp;nbsp;wiped&amp;nbsp;my hard drive so I can make new partitions for linux also which meant I have to re-install windows too. Now I have to install and&amp;nbsp;configure&amp;nbsp;everything to how it was before. I know I wouldn&#39;t be able to do all this at once. I probably will miss stuff out and only realize that when I&#39;m about to use it.&lt;br /&gt;
&lt;br /&gt;
Well anyway now I have a fresh Windows 7 installed and linux mint 14.</content><link rel='replies' type='application/atom+xml' href='http://gamemakersgroup.blogspot.com/feeds/8740688404471263479/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://gamemakersgroup.blogspot.com/2013/01/fresh-start-sigh.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2686707142569253144/posts/default/8740688404471263479'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2686707142569253144/posts/default/8740688404471263479'/><link rel='alternate' type='text/html' href='http://gamemakersgroup.blogspot.com/2013/01/fresh-start-sigh.html' title='fresh start *sigh*'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2686707142569253144.post-5135670873602889191</id><published>2012-11-22T17:48:00.000-08:00</published><updated>2012-11-22T17:49:55.249-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="C++"/><category scheme="http://www.blogger.com/atom/ns#" term="C++ and SDL_Net"/><category scheme="http://www.blogger.com/atom/ns#" term="Game"/><category scheme="http://www.blogger.com/atom/ns#" term="Programming"/><category scheme="http://www.blogger.com/atom/ns#" term="Server"/><title type='text'>Compact Packets. [Networking]</title><content type='html'>I&#39;ve always wanted to make an online game. I was just thinking about ways of sending data to the client and I started thinking about sending the user data about the current game such as if it is day or night and if it is sunny or if it is rainy. you can also have sunny and rainy and stuff like that.&lt;br /&gt;
&lt;br /&gt;
So lets say we have 8 things we want to represent and send to the user in a typical ORPG: light, rain, fog, wind, sun, day, ice and tide. So any of these can either be true or false. so representing them in C++ program will be using&amp;nbsp;Boolean&amp;nbsp;which will 1 byte or 8 bits each. but we&#39;re only using a bit to represent if it is either true or false and the rest of the 7 bits are going to waste.&lt;br /&gt;
&lt;br /&gt;
I make a small program in C++ to show you how to store all these 8 items in just one byte of data.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: #38761d; font-family: Courier New, Courier, monospace;&quot;&gt;#include &amp;lt;iostream&amp;gt;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: #38761d; font-family: Courier New, Courier, monospace;&quot;&gt;#include &amp;lt;string&amp;gt;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: #38761d; font-family: Courier New, Courier, monospace;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/b&gt;
&lt;b&gt;&lt;span style=&quot;color: #38761d; font-family: Courier New, Courier, monospace;&quot;&gt;using namespace std;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: #38761d; font-family: Courier New, Courier, monospace;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/b&gt;
&lt;b&gt;&lt;span style=&quot;color: #38761d; font-family: Courier New, Courier, monospace;&quot;&gt;// light rain fog wind sun day ice tide - 8 options&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: #38761d; font-family: Courier New, Courier, monospace;&quot;&gt;// &amp;nbsp; x &amp;nbsp; &amp;nbsp;x &amp;nbsp; &amp;nbsp;x &amp;nbsp; &amp;nbsp;x &amp;nbsp; x &amp;nbsp; x &amp;nbsp; x &amp;nbsp; x &amp;nbsp; - 8 bits/1 byte&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: #38761d; font-family: Courier New, Courier, monospace;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/b&gt;
&lt;b&gt;&lt;span style=&quot;color: #38761d; font-family: Courier New, Courier, monospace;&quot;&gt;#define LIGHT 128 //10000000&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: #38761d; font-family: Courier New, Courier, monospace;&quot;&gt;#define RAIN &amp;nbsp;64 &amp;nbsp;//01000000&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: #38761d; font-family: Courier New, Courier, monospace;&quot;&gt;#define FOG &amp;nbsp; 32 &amp;nbsp;//00100000&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: #38761d; font-family: Courier New, Courier, monospace;&quot;&gt;#define WIND &amp;nbsp;16 &amp;nbsp;//00010000&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: #38761d; font-family: Courier New, Courier, monospace;&quot;&gt;#define SUN &amp;nbsp; 8 &amp;nbsp; //00001000&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: #38761d; font-family: Courier New, Courier, monospace;&quot;&gt;#define DAY &amp;nbsp; 4 &amp;nbsp; //00000100&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: #38761d; font-family: Courier New, Courier, monospace;&quot;&gt;#define ICE &amp;nbsp; 2 &amp;nbsp; //00000010&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: #38761d; font-family: Courier New, Courier, monospace;&quot;&gt;#define TIDE &amp;nbsp;1 &amp;nbsp; //00000001&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: #38761d; font-family: Courier New, Courier, monospace;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/b&gt;
&lt;b&gt;&lt;span style=&quot;color: #38761d; font-family: Courier New, Courier, monospace;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/b&gt;
&lt;b&gt;&lt;span style=&quot;color: #38761d; font-family: Courier New, Courier, monospace;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/b&gt;
&lt;b&gt;&lt;span style=&quot;color: #38761d; font-family: Courier New, Courier, monospace;&quot;&gt;class Packet&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: #38761d; font-family: Courier New, Courier, monospace;&quot;&gt;{&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: #38761d; font-family: Courier New, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;private:&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: #38761d; font-family: Courier New, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;__int8 packet;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: #38761d; font-family: Courier New, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;public:&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: #38761d; font-family: Courier New, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;Packet(__int8 state)&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: #38761d; font-family: Courier New, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;{&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: #38761d; font-family: Courier New, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;packet = state;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: #38761d; font-family: Courier New, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;};&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: #38761d; font-family: Courier New, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;string isSet(__int8 state)&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: #38761d; font-family: Courier New, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;{&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: #38761d; font-family: Courier New, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;return (packet &amp;amp; state)?&quot;True&quot;:&quot;False&quot;;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: #38761d; font-family: Courier New, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;}&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: #38761d; font-family: Courier New, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;void printStatus()&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: #38761d; font-family: Courier New, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;{&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: #38761d; font-family: Courier New, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;cout &amp;lt;&amp;lt; &quot;\nLIGHT: &quot; &amp;lt;&amp;lt; isSet(LIGHT);&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: #38761d; font-family: Courier New, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;cout &amp;lt;&amp;lt; &quot;\nRAIN: &quot; &amp;nbsp;&amp;lt;&amp;lt; isSet(RAIN);&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: #38761d; font-family: Courier New, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;cout &amp;lt;&amp;lt; &quot;\nFOG: &quot; &amp;nbsp; &amp;lt;&amp;lt; isSet(FOG);&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: #38761d; font-family: Courier New, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;cout &amp;lt;&amp;lt; &quot;\nWIND: &quot; &amp;nbsp;&amp;lt;&amp;lt; isSet(WIND);&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: #38761d; font-family: Courier New, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;cout &amp;lt;&amp;lt; &quot;\nSUN: &quot; &amp;nbsp; &amp;lt;&amp;lt; isSet(SUN);&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: #38761d; font-family: Courier New, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;cout &amp;lt;&amp;lt; &quot;\nDAY: &quot; &amp;nbsp; &amp;lt;&amp;lt; isSet(DAY);&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: #38761d; font-family: Courier New, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;cout &amp;lt;&amp;lt; &quot;\nICE: &quot; &amp;nbsp; &amp;lt;&amp;lt; isSet(ICE);&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: #38761d; font-family: Courier New, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;cout &amp;lt;&amp;lt; &quot;\nTIDE: &quot; &amp;nbsp;&amp;lt;&amp;lt; isSet(TIDE);&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: #38761d; font-family: Courier New, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;}&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: #38761d; font-family: Courier New, Courier, monospace;&quot;&gt;};&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: #38761d; font-family: Courier New, Courier, monospace;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/b&gt;
&lt;b&gt;&lt;span style=&quot;color: #38761d; font-family: Courier New, Courier, monospace;&quot;&gt;int main()&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: #38761d; font-family: Courier New, Courier, monospace;&quot;&gt;{&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: #38761d; font-family: Courier New, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;Packet myPacket(RAIN|TIDE); // you can have as many in here such as LIGHT | FOG | WIND etc. you have to separate them using the | symbol.&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: #38761d; font-family: Courier New, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;myPacket.printStatus();&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: #38761d; font-family: Courier New, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;return 0;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: #38761d; font-family: Courier New, Courier, monospace;&quot;&gt;}&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
In a typical program, this may not seem as useful since we&#39;re doing more work for saving a few bytes, but for example in an online game where bandwidth is important, kind of, we can save and maybe the server response time will be faster.&amp;nbsp;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
(Of course if we was implementing it in a real life game, we probably not have these variables as we still need &amp;nbsp;space for the header but it does explain what I am trying to say)&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://gamemakersgroup.blogspot.com/feeds/5135670873602889191/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://gamemakersgroup.blogspot.com/2012/11/making-packet-smaller-networking.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2686707142569253144/posts/default/5135670873602889191'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2686707142569253144/posts/default/5135670873602889191'/><link rel='alternate' type='text/html' href='http://gamemakersgroup.blogspot.com/2012/11/making-packet-smaller-networking.html' title='Compact Packets. [Networking]'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2686707142569253144.post-4251865687838088337</id><published>2012-11-22T15:54:00.000-08:00</published><updated>2012-11-22T15:54:32.515-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="C++"/><category scheme="http://www.blogger.com/atom/ns#" term="codeblocks"/><title type='text'>C++ Decimal to Binary Converter with sample code</title><content type='html'>&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiyq4Oyj1wKlnj7OSD3O4L3W5_Qwxl2aakuzjKTZrm3-oHddSYbGlD8fNZ-h7uVI4T7-haO9nYUexESGA-YUxPuxAqcE9PywLKUCYWngMnLS_0331lzGSnReoKDiOQ4YA_0fTxUz9MFpBkB/s1600/DecToBin.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;200&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiyq4Oyj1wKlnj7OSD3O4L3W5_Qwxl2aakuzjKTZrm3-oHddSYbGlD8fNZ-h7uVI4T7-haO9nYUexESGA-YUxPuxAqcE9PywLKUCYWngMnLS_0331lzGSnReoKDiOQ4YA_0fTxUz9MFpBkB/s400/DecToBin.png&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
A Quick C++ Console program I create that asks the user to enter a number between 0 and 65,535 and it outputs it in binary.&lt;br /&gt;
&lt;br /&gt;
The&amp;nbsp;approach that I tuck was completely original. I don&#39;t know if anyone has tried it before but I just thought it was cool and thought it was the right way to do it. it may not be the quickest way but it sure worked.&lt;br /&gt;
&lt;br /&gt;
The code is bellow. As you can see, it is not commented and no documentation as I didn&#39;t spend much time on it, but if people want to know what&#39;s happening then please email me or comment and I will get back to you or comment it for all.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: #38761d;&quot;&gt;&lt;b&gt;#include &amp;lt;iostream&amp;gt;&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #38761d;&quot;&gt;&lt;b&gt;#include &amp;lt;string&amp;gt;&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #38761d;&quot;&gt;&lt;b&gt;#include &amp;lt;cassert&amp;gt;&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #38761d;&quot;&gt;&lt;b&gt;#include &amp;lt;sstream&amp;gt;&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #38761d;&quot;&gt;&lt;b&gt;#include &amp;lt;stdlib.h&amp;gt;&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #38761d;&quot;&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/span&gt;
&lt;span style=&quot;color: #38761d;&quot;&gt;&lt;b&gt;using namespace std;&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #38761d;&quot;&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/span&gt;
&lt;span style=&quot;color: #38761d;&quot;&gt;&lt;b&gt;string toBin(unsigned short int number)&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #38761d;&quot;&gt;&lt;b&gt;{&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #38761d;&quot;&gt;&lt;b&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;stringstream out;&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #38761d;&quot;&gt;&lt;b&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;cout &amp;lt;&amp;lt; &quot;sizeof number &quot; &amp;lt;&amp;lt; sizeof(number) &amp;lt;&amp;lt; endl;&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #38761d;&quot;&gt;&lt;b&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;for(int x = sizeof(number)*8; x &amp;gt; 0; x--)&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #38761d;&quot;&gt;&lt;b&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;{&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #38761d;&quot;&gt;&lt;b&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;int n = (number &amp;gt;&amp;gt; (x-1));&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #38761d;&quot;&gt;&lt;b&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;out &amp;lt;&amp;lt; n;&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #38761d;&quot;&gt;&lt;b&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;number -= (n&amp;lt;&amp;lt; (x-1));&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;&lt;span style=&quot;color: #38761d;&quot;&gt;&lt;b&gt;  &lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #38761d;&quot;&gt;&lt;b&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;}&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #38761d;&quot;&gt;&lt;b&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;return out.str();&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #38761d;&quot;&gt;&lt;b&gt;}&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #38761d;&quot;&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/span&gt;
&lt;span style=&quot;color: #38761d;&quot;&gt;&lt;b&gt;int main(int argc, char* argv[])&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #38761d;&quot;&gt;&lt;b&gt;{&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #38761d;&quot;&gt;&lt;b&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;assert(argc &amp;gt; 0);&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;&lt;span style=&quot;color: #38761d;&quot;&gt;&lt;b&gt; &lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #38761d;&quot;&gt;&lt;b&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;cout &amp;lt;&amp;lt; &quot;\t*Welcome to the Decimal to Binary Calculator!*\n\n&quot;;&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;&lt;span style=&quot;color: #38761d;&quot;&gt;&lt;b&gt; &lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #38761d;&quot;&gt;&lt;b&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;bool quit = false;&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;&lt;span style=&quot;color: #38761d;&quot;&gt;&lt;b&gt; &lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #38761d;&quot;&gt;&lt;b&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;while(!quit)&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #38761d;&quot;&gt;&lt;b&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;{&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #38761d;&quot;&gt;&lt;b&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;cout &amp;lt;&amp;lt; &quot;Enter a value to convert (most be between 0 and a 65,535. press q to quiet)\n&quot;;&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #38761d;&quot;&gt;&lt;b&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;cout &amp;lt;&amp;lt; &quot;Entery: \t&quot;;&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #38761d;&quot;&gt;&lt;b&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;string input;&amp;nbsp;&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #38761d;&quot;&gt;&lt;b&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;cin &amp;gt;&amp;gt; input;&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #38761d;&quot;&gt;&lt;b&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;if(input == &quot;q&quot;) return 0;&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;&lt;span style=&quot;color: #38761d;&quot;&gt;&lt;b&gt;  &lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #38761d;&quot;&gt;&lt;b&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;assert((atoi(input.c_str()) &amp;gt;= 0) &amp;amp;&amp;amp; (atoi(input.c_str()) &amp;lt;= 65535));&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #38761d;&quot;&gt;&lt;b&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;cout &amp;lt;&amp;lt; &quot;converting to binary...\t&quot; &amp;lt;&amp;lt; toBin(atoi(input.c_str())) &amp;lt;&amp;lt; &quot;\n\n&quot;;&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #38761d;&quot;&gt;&lt;b&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;}&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #38761d;&quot;&gt;&lt;b&gt;}&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;</content><link rel='replies' type='application/atom+xml' href='http://gamemakersgroup.blogspot.com/feeds/4251865687838088337/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://gamemakersgroup.blogspot.com/2012/11/c-decimal-to-binary-converter-with.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2686707142569253144/posts/default/4251865687838088337'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2686707142569253144/posts/default/4251865687838088337'/><link rel='alternate' type='text/html' href='http://gamemakersgroup.blogspot.com/2012/11/c-decimal-to-binary-converter-with.html' title='C++ Decimal to Binary Converter with sample code'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiyq4Oyj1wKlnj7OSD3O4L3W5_Qwxl2aakuzjKTZrm3-oHddSYbGlD8fNZ-h7uVI4T7-haO9nYUexESGA-YUxPuxAqcE9PywLKUCYWngMnLS_0331lzGSnReoKDiOQ4YA_0fTxUz9MFpBkB/s72-c/DecToBin.png" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2686707142569253144.post-4669475133916704719</id><published>2012-10-21T16:56:00.003-07:00</published><updated>2012-10-21T16:56:30.933-07:00</updated><title type='text'>One of my articles in a magazine</title><content type='html'>&lt;span style=&quot;font-family: inherit;&quot;&gt;I don&#39;t know if many of you remember a post I did a while ago about &quot;H&lt;span style=&quot;background-color: white;&quot;&gt;ow to&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;background-color: white;&quot;&gt;Create your own video game&lt;/span&gt;&lt;span style=&quot;background-color: white;&quot;&gt;&quot;, well I submitted it to a magazine called BlenderArt. And it is inside there issue 38: Power of Compositing.&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;span style=&quot;background-color: white;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;span style=&quot;background-color: white;&quot;&gt;If anyone want to go ahead and read you can download it from this link:&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: white;&quot;&gt;&lt;a href=&quot;http://blendertestbuilds.de/download.php?file=blenderart_mag/blenderart_mag-38_eng.zip&quot;&gt;http://blendertestbuilds.de/download.php?file=blenderart_mag/blenderart_mag-38_eng.zip&lt;/a&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: white;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;background-color: white;&quot;&gt;or you can go to the blender art magazine website and see other issues also.&lt;/span&gt;&lt;br /&gt;
&lt;a href=&quot;http://blenderart.org/issues/&quot;&gt;http://blenderart.org/issues/&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;</content><link rel='replies' type='application/atom+xml' href='http://gamemakersgroup.blogspot.com/feeds/4669475133916704719/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://gamemakersgroup.blogspot.com/2012/10/one-of-my-articles-in-magazine.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2686707142569253144/posts/default/4669475133916704719'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2686707142569253144/posts/default/4669475133916704719'/><link rel='alternate' type='text/html' href='http://gamemakersgroup.blogspot.com/2012/10/one-of-my-articles-in-magazine.html' title='One of my articles in a magazine'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2686707142569253144.post-126589805985810148</id><published>2012-09-30T15:55:00.001-07:00</published><updated>2012-09-30T15:55:30.110-07:00</updated><title type='text'>New Set of Tutorials</title><content type='html'>I haven&#39;t updated this blog in a while but I am planning on making and releasing a set of tutorials dealing with SDL_net and C++ and also python. These tutorials will mostly cover networking and security but they will be useful for anyone learning online gaming, networking and security also.&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
So keep tuned in and I will update soon!&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://gamemakersgroup.blogspot.com/feeds/126589805985810148/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://gamemakersgroup.blogspot.com/2012/09/new-set-of-tutorials.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2686707142569253144/posts/default/126589805985810148'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2686707142569253144/posts/default/126589805985810148'/><link rel='alternate' type='text/html' href='http://gamemakersgroup.blogspot.com/2012/09/new-set-of-tutorials.html' title='New Set of Tutorials'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2686707142569253144.post-7989571640330215596</id><published>2012-08-12T14:18:00.001-07:00</published><updated>2012-08-12T14:18:29.653-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Game Idea&#39;s"/><category scheme="http://www.blogger.com/atom/ns#" term="Make your own game"/><title type='text'>Still Dreaming..</title><content type='html'>Sometimes I sit down and I think about what I could do if I had so much free time, maybe a couple of months (2 or 3 maybe), I would like to create a game with out stopping on it.&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
It has been too many times that I have given up on a project when I leave it for a while. I don&#39;t think I will be free for a while which means I need to make sometime to create the games I wish to create.&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
Lately I have been dreaming about the old&#39;en days retro games. The pixel art was perfect and they just stayed with you through out your childhood. I just wish to create a game like that, rich in story line and maybe has a good fan base that will be very supportive.&amp;nbsp;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
When I do get myself to make sometime for the next projects, I will also &amp;nbsp; have to look at some console publishing!..&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://gamemakersgroup.blogspot.com/feeds/7989571640330215596/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://gamemakersgroup.blogspot.com/2012/08/still-dreaming.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2686707142569253144/posts/default/7989571640330215596'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2686707142569253144/posts/default/7989571640330215596'/><link rel='alternate' type='text/html' href='http://gamemakersgroup.blogspot.com/2012/08/still-dreaming.html' title='Still Dreaming..'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2686707142569253144.post-6566640689134578357</id><published>2012-08-05T17:20:00.000-07:00</published><updated>2012-08-05T17:20:28.411-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Curiosity"/><category scheme="http://www.blogger.com/atom/ns#" term="landing time GMT"/><category scheme="http://www.blogger.com/atom/ns#" term="Mars Rover"/><category scheme="http://www.blogger.com/atom/ns#" term="rover landing"/><title type='text'>Tonight Mars Rover Curiosity landing [GMT]</title><content type='html'>I have been waiting for this for so long!&lt;br /&gt;
&lt;br /&gt;
Tonight, the mars rover curiosity is landing and I think this is very exciting.&amp;nbsp;Every time&amp;nbsp;there is something happening in space, it is good since we are exploring the outer world. But when it is to do with our next door planet Mars, I really have to follow.&lt;br /&gt;
&lt;br /&gt;
Mars is kind of the next step to the human kind and I think we should&amp;nbsp;at least&amp;nbsp;visit it and if we could, colonize it. As you may of heard over and over that mars is very much like earth. It has seasons and a day period which is close to earth etc...&lt;br /&gt;
&lt;br /&gt;
But I am really interested in mars and if I could, I would go and live there.&lt;br /&gt;
&lt;br /&gt;
Anyway, the mars rover is landing tonight and I am staying away to watch it. There is a lot of places you can watch it online. I am sticking to the official NASA website&amp;nbsp;&lt;a href=&quot;http://www.nasa.gov/multimedia/nasatv/index.html&quot;&gt;http://www.nasa.gov/multimedia/nasatv/index.html&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
I tried looking at the websites for what time the landing is going to be and all I could find is time in EST and PDT or PST but I wanted it in GMT since I live in the UK. Well the rover is meant to be landing at 10:17 p.m. PDT which is around 5:17 a.m. GMT give or take a few minutes.&lt;br /&gt;
&lt;br /&gt;
So if you would like to have some sleep and set your alarms for 5ish to watch it, that would be cool.&lt;br /&gt;
&lt;br /&gt;
&lt;h2&gt;
&lt;div style=&quot;text-align: center;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;b&gt;&lt;div style=&quot;text-align: center;&quot;&gt;
&lt;b&gt;5:17 a.m. GMT&lt;/b&gt;&lt;/div&gt;
&lt;/b&gt;&lt;/h2&gt;</content><link rel='replies' type='application/atom+xml' href='http://gamemakersgroup.blogspot.com/feeds/6566640689134578357/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://gamemakersgroup.blogspot.com/2012/08/tonight-mars-rover-curiosity-landing-gmt.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2686707142569253144/posts/default/6566640689134578357'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2686707142569253144/posts/default/6566640689134578357'/><link rel='alternate' type='text/html' href='http://gamemakersgroup.blogspot.com/2012/08/tonight-mars-rover-curiosity-landing-gmt.html' title='Tonight Mars Rover Curiosity landing [GMT]'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2686707142569253144.post-272251035802369120</id><published>2012-08-04T03:47:00.002-07:00</published><updated>2012-08-04T03:47:48.033-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="3D/2D game development"/><category scheme="http://www.blogger.com/atom/ns#" term="Game"/><category scheme="http://www.blogger.com/atom/ns#" term="Programming"/><category scheme="http://www.blogger.com/atom/ns#" term="Python"/><title type='text'>Python game programming with PyGame!</title><content type='html'>I think python is a great programming/scripting language and I enjoy using it.&lt;br /&gt;
&lt;br /&gt;
Usually I use python only with blender or to make console applications such as servers or chat systems. I have heard of the software pygame a while ago but only got around to use it recently. Since I have already used SDL before, I knew exactly what was going on since it is made using SDL.&lt;br /&gt;
&lt;br /&gt;
It is much easier to use than SDL and it is good for those who want to implement the game right away instead of having to program a lot. This could be good for prototyping or for artists who do not know much coding and want to test out there art in the game.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;pre&gt;import pygame, sys
pygame.init()

size = width, height = 640, 480
speed = [0,0]
black = 0,0,0

screen = pygame.display.set_mode(size)

player = pygame.image.load(&quot;player.bmp&quot;)
player_rect = player.get_rect()

while 1:
 speed = [0,0]
 for event in pygame.event.get():
  if event.type == pygame.QUIT:
   sys.exit()
  if event.type == pygame.KEYDOWN:
   if event.key == pygame.K_UP:
    speed = [0,-5]
   if event.key == pygame.K_DOWN:
    speed = [0,5]
   if event.key == pygame.K_LEFT:
    speed = [-5,0]
   if event.key == pygame.K_RIGHT:
    speed = [5,0]
    
 if player_rect.top &amp;lt; 0:
  speed = [0,5]
 if player_rect.bottom &amp;gt; height:
  speed = [0,-5]
 if player_rect.left &amp;lt; 0:
  speed = [5,0]
 if player_rect.right &amp;gt; width:
  speed = [-5,0]
 player_rect = player_rect.move(speed)
 screen.fill(black)
 screen.blit(player,player_rect)
 pygame.display.flip()
&lt;/pre&gt;
&lt;br /&gt;
The above code is an example of a simple program made in python using pygame. To run this code you will need python 3.2 installed and pygame for python 3.2. You also need the picture bellow in the same folder as the saved .py file with the code. save the image as player.bmp&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg7KpWEwF2YS5xZNDM6Nt6LYB-MPJYx2K33SmF0sp0s-Dgr2lItLlRQY8nYCfHhK-79ykE3vsAlfwBFP4Y2oUkAdZ8LJHPoDVMzVrhchIktLknbLWJY-ZEQynR3FMf2W71mDZo4uM6pIJSj/s1600/player.bmp&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg7KpWEwF2YS5xZNDM6Nt6LYB-MPJYx2K33SmF0sp0s-Dgr2lItLlRQY8nYCfHhK-79ykE3vsAlfwBFP4Y2oUkAdZ8LJHPoDVMzVrhchIktLknbLWJY-ZEQynR3FMf2W71mDZo4uM6pIJSj/s1600/player.bmp&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
I will try and use it a little bit as you can use it to test out ideas and you do not have to code much.&lt;/div&gt;
&lt;br /&gt;</content><link rel='replies' type='application/atom+xml' href='http://gamemakersgroup.blogspot.com/feeds/272251035802369120/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://gamemakersgroup.blogspot.com/2012/08/python-game-programming-with-pygame.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2686707142569253144/posts/default/272251035802369120'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2686707142569253144/posts/default/272251035802369120'/><link rel='alternate' type='text/html' href='http://gamemakersgroup.blogspot.com/2012/08/python-game-programming-with-pygame.html' title='Python game programming with PyGame!'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg7KpWEwF2YS5xZNDM6Nt6LYB-MPJYx2K33SmF0sp0s-Dgr2lItLlRQY8nYCfHhK-79ykE3vsAlfwBFP4Y2oUkAdZ8LJHPoDVMzVrhchIktLknbLWJY-ZEQynR3FMf2W71mDZo4uM6pIJSj/s72-c/player.bmp" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2686707142569253144.post-7437633434849252409</id><published>2012-08-02T16:02:00.002-07:00</published><updated>2012-08-02T16:02:53.324-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="proxy"/><category scheme="http://www.blogger.com/atom/ns#" term="the pirate bay"/><category scheme="http://www.blogger.com/atom/ns#" term="unblock pirate bay"/><title type='text'>Access The Pirate Bay [Unblock]</title><content type='html'>I know this isn&#39;t part of game development or as such in anyway related but I think the problem with people having access to pirate bay is a big one.&lt;br /&gt;
&lt;br /&gt;
I enjoy using pirate bay for personal use and I think it is a shame that some network providers have blocked it and my network provider is one of them. I have found some proxy websites which I thing are very useful and this is the way I have been accessing the pirate bay.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;ul style=&quot;background-color: #f8f8f8; font-family: Arial, Verdana, Helvetica, Tahoma, Geneva, sans-serif; font-size: 15.555556297302246px; list-style: none; margin: 0px 0px 15px 15px; padding: 0px;&quot;&gt;
&lt;li style=&quot;background-image: url(http://blog.tdobson.net/wp-content/themes/zeeb/images/tiny-dot.gif); background-position: 0% 0%; background-repeat: no-repeat no-repeat; margin: 0px; padding: 0px 0px 0px 15px;&quot;&gt;&lt;a href=&quot;http://tpb.pirateparty.org.uk/&quot; style=&quot;color: #666666; margin: 0px; padding: 0px;&quot;&gt;http://tpb.pirateparty.org.uk&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;ul style=&quot;background-color: #f8f8f8; font-family: Arial, Verdana, Helvetica, Tahoma, Geneva, sans-serif; font-size: 15.555556297302246px; list-style: none; margin: 0px 0px 15px 15px; padding: 0px;&quot;&gt;
&lt;li style=&quot;background-image: url(http://blog.tdobson.net/wp-content/themes/zeeb/images/tiny-dot.gif); background-position: 0% 0%; background-repeat: no-repeat no-repeat; margin: 0px; padding: 0px 0px 0px 15px;&quot;&gt;&lt;a href=&quot;http://www.pirateproxy.net/&quot; style=&quot;color: #666666; margin: 0px; padding: 0px;&quot;&gt;http://www.pirateproxy.net/&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;ul style=&quot;background-color: #f8f8f8; font-family: Arial, Verdana, Helvetica, Tahoma, Geneva, sans-serif; font-size: 15.555556297302246px; list-style: none; margin: 0px 0px 15px 15px; padding: 0px;&quot;&gt;
&lt;li style=&quot;background-image: url(http://blog.tdobson.net/wp-content/themes/zeeb/images/tiny-dot.gif); background-position: 0% 0%; background-repeat: no-repeat no-repeat; margin: 0px; padding: 0px 0px 0px 15px;&quot;&gt;&lt;a href=&quot;http://all4xs.net/repress/thepiratebay.se&quot; style=&quot;color: #666666; margin: 0px; padding: 0px;&quot;&gt;http://all4xs.net/repress/thepiratebay.se&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;ul style=&quot;background-color: #f8f8f8; font-family: Arial, Verdana, Helvetica, Tahoma, Geneva, sans-serif; font-size: 15.555556297302246px; list-style: none; margin: 0px 0px 15px 15px; padding: 0px;&quot;&gt;
&lt;li style=&quot;background-image: url(http://blog.tdobson.net/wp-content/themes/zeeb/images/tiny-dot.gif); background-position: 0% 0%; background-repeat: no-repeat no-repeat; margin: 0px; padding: 0px 0px 0px 15px;&quot;&gt;&lt;a href=&quot;http://labaia.ws/&quot; style=&quot;color: #666666; margin: 0px; padding: 0px;&quot;&gt;http://labaia.ws/&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;ul style=&quot;background-color: #f8f8f8; font-family: Arial, Verdana, Helvetica, Tahoma, Geneva, sans-serif; font-size: 15.555556297302246px; list-style: none; margin: 0px 0px 15px 15px; padding: 0px;&quot;&gt;
&lt;li style=&quot;background-image: url(http://blog.tdobson.net/wp-content/themes/zeeb/images/tiny-dot.gif); background-position: 0% 0%; background-repeat: no-repeat no-repeat; margin: 0px; padding: 0px 0px 0px 15px;&quot;&gt;&lt;a href=&quot;http://lanunbay.org/&quot; style=&quot;color: #666666; margin: 0px; padding: 0px;&quot;&gt;http://lanunbay.org/&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;ul style=&quot;background-color: #f8f8f8; font-family: Arial, Verdana, Helvetica, Tahoma, Geneva, sans-serif; font-size: 15.555556297302246px; list-style: none; margin: 0px 0px 15px 15px; padding: 0px;&quot;&gt;
&lt;li style=&quot;background-image: url(http://blog.tdobson.net/wp-content/themes/zeeb/images/tiny-dot.gif); background-position: 0% 0%; background-repeat: no-repeat no-repeat; margin: 0px; padding: 0px 0px 0px 15px;&quot;&gt;&lt;a href=&quot;http://malaysiabay.org/&quot; style=&quot;color: #666666; margin: 0px; padding: 0px;&quot;&gt;http://malaysiabay.org/&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;ul style=&quot;background-color: #f8f8f8; font-family: Arial, Verdana, Helvetica, Tahoma, Geneva, sans-serif; font-size: 15.555556297302246px; list-style: none; margin: 0px 0px 15px 15px; padding: 0px;&quot;&gt;
&lt;li style=&quot;background-image: url(http://blog.tdobson.net/wp-content/themes/zeeb/images/tiny-dot.gif); background-position: 0% 0%; background-repeat: no-repeat no-repeat; margin: 0px; padding: 0px 0px 0px 15px;&quot;&gt;&lt;a href=&quot;http://alt.ragerik.info/&quot; style=&quot;color: #666666; margin: 0px; padding: 0px;&quot;&gt;http://alt.ragerik.info/&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;ul style=&quot;background-color: #f8f8f8; font-family: Arial, Verdana, Helvetica, Tahoma, Geneva, sans-serif; font-size: 15.555556297302246px; list-style: none; margin: 0px 0px 15px 15px; padding: 0px;&quot;&gt;
&lt;li style=&quot;background-image: url(http://blog.tdobson.net/wp-content/themes/zeeb/images/tiny-dot.gif); background-position: 0% 0%; background-repeat: no-repeat no-repeat; margin: 0px; padding: 0px 0px 0px 15px;&quot;&gt;&lt;a href=&quot;http://tpb.europeancensorship.eu/nph-tpb.cgi/http/thepiratebay.se/&quot; style=&quot;color: #666666; margin: 0px; padding: 0px;&quot;&gt;http://tpb.europeancensorship.eu/nph-tpb.cgi/http/thepiratebay.se/&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: Arial, Verdana, Helvetica, Tahoma, Geneva, sans-serif;&quot;&gt;My&amp;nbsp;personal&amp;nbsp;favorite&amp;nbsp;is the first one.&lt;/span&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://gamemakersgroup.blogspot.com/feeds/7437633434849252409/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://gamemakersgroup.blogspot.com/2012/08/access-pirate-bay-unblock.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2686707142569253144/posts/default/7437633434849252409'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2686707142569253144/posts/default/7437633434849252409'/><link rel='alternate' type='text/html' href='http://gamemakersgroup.blogspot.com/2012/08/access-pirate-bay-unblock.html' title='Access The Pirate Bay [Unblock]'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2686707142569253144.post-6649233402769804948</id><published>2012-07-31T06:13:00.001-07:00</published><updated>2012-07-31T06:13:20.386-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Game"/><category scheme="http://www.blogger.com/atom/ns#" term="Python"/><title type='text'>Simple Tic Tac Toe Game in python</title><content type='html'>I made a simple game in python which just shows how you can use python. I haven&#39;t used classes but I did use functions. This is a basic game and someone with some experience with python will be able to follow this.&lt;br /&gt;
&lt;br /&gt;
I will eventually make a detailed tutorials on how to make it and what exactly I am doing but for now this is it.&lt;br /&gt;
&lt;br /&gt;
&lt;hr /&gt;
&lt;pre&gt;from random import *

#the board table
board = [&quot;-&quot;,&quot;-&quot;,&quot;-&quot;,\
&quot;-&quot;,&quot;-&quot;,&quot;-&quot;,\
&quot;-&quot;,&quot;-&quot;,&quot;-&quot;]

#the numbers table
board_0 = [&quot;1&quot;,&quot;2&quot;,&quot;3&quot;,&quot;4&quot;,&quot;5&quot;,&quot;6&quot;,&quot;7&quot;,&quot;8&quot;,&quot;9&quot;]

#symbol for computer and user
computer_symbol = &quot;&quot;
user_symbol = &quot;&quot;

#how many boxes are filled
filled = 0

#check if player has won

def check_winner(l_board):
    if (l_board[0] == l_board[1] == l_board[2]) and l_board[0] != &quot;-&quot;:
        print(l_board[0] , &quot;wins!&quot;)
        return 0
    if (l_board[3] == l_board[4] == l_board[5]) and l_board[3] != &quot;-&quot;:
        print(l_board[3] , &quot;wins!&quot;)
        return 0
    if (l_board[6] == l_board[7] == l_board[8]) and l_board[6] != &quot;-&quot;:
        print(l_board[6] , &quot;wins!&quot;)
        return 0
    if (l_board[0] == l_board[3] == l_board[6]) and l_board[0] != &quot;-&quot;:
        print(l_board[0] , &quot;wins!&quot;)
        return 0
    if (l_board[1] == l_board[4] == l_board[7]) and l_board[1] != &quot;-&quot;:
        print(l_board[1] , &quot;wins!&quot;)
        return 0
    if (l_board[2] == l_board[5] == l_board[8]) and l_board[2] != &quot;-&quot;:
        print(l_board[2] , &quot;wins!&quot;)
        return 0
    if (l_board[0] == l_board[4] == l_board[8]) and l_board[0] != &quot;-&quot;:
        print(l_board[0] , &quot;wins!&quot;)
        return 0
    if (l_board[2] == l_board[4] == l_board[6]) and l_board[2] != &quot;-&quot;:
        print(l_board[2] , &quot;wins!&quot;)
        return 0
    return 1

#print out a board
def print_board(l_board,message):
    print(&quot;     &quot;+message)
    hr = &quot;\t_____________\n&quot;
    table = hr
    table += &quot;\t| &quot;+l_board[0] + &quot; | &quot; + l_board[1] + &quot; | &quot; + l_board[2] + &quot; | \n&quot;
    table += hr + &quot;\t| &quot;+l_board[3] + &quot; | &quot; + l_board[4] + &quot; | &quot; + l_board[5] + &quot; | \n&quot;
    table += hr + &quot;\t| &quot;+l_board[6] + &quot; | &quot; + l_board[7] + &quot; | &quot; + l_board[8] + &quot; | \n&quot; + hr
    print(table)

#computer moves randomly. no AI
def computer_move(l_board):
    global filled
    while True:
        x = int(random() * 10)%9
        if(l_board[x] != &quot;-&quot;):
            continue
        else:
            l_board[x] = computer_symbol
            filled += 1
            return 0

#user makes a move and checks if the box is already filled
def user_move(l_board):
    global filled
    while True:
        x = input(&quot;(1-9)&amp;lt;&amp;lt;&quot;)
        if(l_board[int(x)-1] != &quot;-&quot;):
            continue
        else:
            l_board[int(x)-1] = user_symbol
            filled += 1
            return 0
    
#the main program
def main():
    global user_symbol
    global computer_symbol
    print(&quot;\tWelcome to Tic Tac Toe - The Game!&quot;)
    print(&quot;\n\nWhich symbol do you prefer? (X or O)? &quot;)
    user_symbol = input(&quot;&amp;lt;&amp;lt;&quot;)
    if (user_symbol == &quot;O&quot;) or (user_symbol == &quot;o&quot;):
        computer_symbol = &quot;X&quot;
        user_symbol = &quot;O&quot;
    else:
        computer_symbol = &quot;O&quot;
        user_symbol = &quot;X&quot;
    while filled &amp;lt; 9:
        print_board(board, &quot;~The Tic Tac Toe Table~&quot;)
        print_board(board_0, &quot;Where do you want to go?&quot;)
        user_move(board)
        if check_winner(board) == 0:
            break
        computer_move(board)
        if check_winner(board) == 0:
            break
    print_board(board, &quot;~The Tic Tac Toe Table~&quot;)

#run the main program
main()

#wait until the user has exit
input()
&lt;/pre&gt;
&lt;hr /&gt;
&lt;br /&gt;
For Tic Tac Toe 2, I will do some AI and make the computer a little more challenging.</content><link rel='replies' type='application/atom+xml' href='http://gamemakersgroup.blogspot.com/feeds/6649233402769804948/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://gamemakersgroup.blogspot.com/2012/07/simple-tic-tac-toe-game-in-python.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2686707142569253144/posts/default/6649233402769804948'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2686707142569253144/posts/default/6649233402769804948'/><link rel='alternate' type='text/html' href='http://gamemakersgroup.blogspot.com/2012/07/simple-tic-tac-toe-game-in-python.html' title='Simple Tic Tac Toe Game in python'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2686707142569253144.post-9005862127127986407</id><published>2012-07-10T06:59:00.003-07:00</published><updated>2012-07-10T06:59:42.940-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="C++"/><category scheme="http://www.blogger.com/atom/ns#" term="Pointers"/><category scheme="http://www.blogger.com/atom/ns#" term="Programming"/><title type='text'>Pointers on C++ Pointers</title><content type='html'>&lt;style type=&quot;text/css&quot;&gt;
 &lt;!--
  @page { margin: 2cm }
  TD P { margin-bottom: 0cm }
  P { margin-bottom: 0.21cm }
 --&gt;
 
&lt;/style&gt;


&lt;br /&gt;
&lt;div style=&quot;margin-bottom: 0cm; text-align: left;&quot;&gt;
&lt;span style=&quot;font-size: large;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;These are just some note you may want to keep handy when working with C++, especially if you are using pointers.&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: large;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;Sometimes it gets confusing of which symbol to use for to get which value or what to assign to what so this just helps you out and gives you some clear notes of what you might be doing. I hope it does help.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;hr /&gt;
&lt;div style=&quot;margin-bottom: 0cm; text-align: left;&quot;&gt;
&lt;span style=&quot;font-size: large;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;b&gt; &lt;/b&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div align=&quot;CENTER&quot; style=&quot;margin-bottom: 0cm;&quot;&gt;
&lt;span style=&quot;font-size: large;&quot;&gt;&lt;b&gt;Notes
about pointers&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;margin-bottom: 0cm;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;margin-bottom: 0cm;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;margin-bottom: 0cm;&quot;&gt;
&lt;span style=&quot;font-size: medium;&quot;&gt;&lt;b&gt;Declaring&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;margin-bottom: 0cm;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;margin-bottom: 0cm;&quot;&gt;
int *pnPtr;&lt;/div&gt;
&lt;div style=&quot;margin-bottom: 0cm;&quot;&gt;
double *pnPtr;&lt;/div&gt;
&lt;div style=&quot;margin-bottom: 0cm;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;margin-bottom: 0cm;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;margin-bottom: 0cm;&quot;&gt;
&lt;span style=&quot;font-size: medium;&quot;&gt;&lt;b&gt;Pointing it to a
variable&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;margin-bottom: 0cm;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;margin-bottom: 0cm;&quot;&gt;
int nNumber = 5;&lt;/div&gt;
&lt;div style=&quot;margin-bottom: 0cm;&quot;&gt;
int *pnPtr = &amp;amp;nNumber;&lt;/div&gt;
&lt;div style=&quot;margin-bottom: 0cm;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;margin-bottom: 0cm;&quot;&gt;
&lt;span style=&quot;font-size: medium;&quot;&gt;&lt;b&gt;Changing the value&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;margin-bottom: 0cm;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;margin-bottom: 0cm;&quot;&gt;
*pnPtr = 7; 
&lt;/div&gt;
&lt;div style=&quot;margin-bottom: 0cm;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;margin-bottom: 0cm;&quot;&gt;
&lt;span style=&quot;font-size: medium;&quot;&gt;&lt;b&gt;Changing the address&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;margin-bottom: 0cm;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;margin-bottom: 0cm;&quot;&gt;
int nNumber2 = 9;&lt;/div&gt;
&lt;div style=&quot;margin-bottom: 0cm;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;margin-bottom: 0cm;&quot;&gt;
pnPtr = &amp;amp;nNumber2;&lt;/div&gt;
&lt;div style=&quot;margin-bottom: 0cm;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;margin-bottom: 0cm;&quot;&gt;
&lt;span style=&quot;font-size: medium;&quot;&gt;&lt;b&gt;Outputs for:&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;margin-bottom: 0cm;&quot;&gt;
&lt;i&gt;&lt;b&gt;int nInteger = 6;&lt;/b&gt;&lt;/i&gt;&lt;/div&gt;
&lt;div style=&quot;margin-bottom: 0cm;&quot;&gt;
&lt;i&gt;&lt;b&gt;int *pnPointer = nInteger;&lt;/b&gt;&lt;/i&gt;&lt;/div&gt;
&lt;div style=&quot;margin-bottom: 0cm;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;margin-bottom: 0cm;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;table cellpadding=&quot;4&quot; cellspacing=&quot;0&quot;&gt;
 &lt;colgroup&gt;&lt;col width=&quot;128*&quot;&gt;&lt;/col&gt;
 &lt;col width=&quot;128*&quot;&gt;&lt;/col&gt;
 &lt;/colgroup&gt;&lt;tbody&gt;
&lt;tr valign=&quot;TOP&quot;&gt;
  &lt;td style=&quot;border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: none; border-top: 1px solid #000000; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0cm; padding-top: 0.1cm;&quot; width=&quot;50%&quot;&gt;&lt;span style=&quot;font-size: medium;&quot;&gt;&lt;b&gt;value&lt;/b&gt;&lt;/span&gt;&lt;/td&gt;
  &lt;td style=&quot;border: 1px solid #000000; padding: 0.1cm;&quot; width=&quot;50%&quot;&gt;&lt;span style=&quot;font-size: medium;&quot;&gt;&lt;b&gt;output&lt;/b&gt;&lt;/span&gt;&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr valign=&quot;TOP&quot;&gt;
  &lt;td style=&quot;border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: none; border-top: none; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0cm; padding-top: 0cm;&quot; width=&quot;50%&quot;&gt;nInteger&lt;/td&gt;
  &lt;td style=&quot;border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: 1px solid #000000; border-top: none; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0.1cm; padding-top: 0cm;&quot; width=&quot;50%&quot;&gt;6&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr valign=&quot;TOP&quot;&gt;
  &lt;td style=&quot;border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: none; border-top: none; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0cm; padding-top: 0cm;&quot; width=&quot;50%&quot;&gt;&amp;amp;nInteger&lt;/td&gt;
  &lt;td style=&quot;border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: 1px solid #000000; border-top: none; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0.1cm; padding-top: 0cm;&quot; width=&quot;50%&quot;&gt;Address of the nInteger&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr valign=&quot;TOP&quot;&gt;
  &lt;td style=&quot;border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: none; border-top: none; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0cm; padding-top: 0cm;&quot; width=&quot;50%&quot;&gt;pnPointer&lt;/td&gt;
  &lt;td style=&quot;border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: 1px solid #000000; border-top: none; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0.1cm; padding-top: 0cm;&quot; width=&quot;50%&quot;&gt;Address of the nInteger&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr valign=&quot;TOP&quot;&gt;
  &lt;td style=&quot;border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: none; border-top: none; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0cm; padding-top: 0cm;&quot; width=&quot;50%&quot;&gt;*pnPointer&lt;/td&gt;
  &lt;td style=&quot;border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: 1px solid #000000; border-top: none; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0.1cm; padding-top: 0cm;&quot; width=&quot;50%&quot;&gt;6&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr valign=&quot;TOP&quot;&gt;
  &lt;td style=&quot;border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: none; border-top: none; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0cm; padding-top: 0cm;&quot; width=&quot;50%&quot;&gt;&amp;amp;pnPointer&lt;/td&gt;
  &lt;td style=&quot;border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: 1px solid #000000; border-top: none; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0.1cm; padding-top: 0cm;&quot; width=&quot;50%&quot;&gt;Address of the pnPointer&lt;/td&gt;
 &lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;div style=&quot;margin-bottom: 0cm;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;margin-bottom: 0cm;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://gamemakersgroup.blogspot.com/feeds/9005862127127986407/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://gamemakersgroup.blogspot.com/2012/07/pointers-on-c-pointers.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2686707142569253144/posts/default/9005862127127986407'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2686707142569253144/posts/default/9005862127127986407'/><link rel='alternate' type='text/html' href='http://gamemakersgroup.blogspot.com/2012/07/pointers-on-c-pointers.html' title='Pointers on C++ Pointers'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2686707142569253144.post-5504477705587960710</id><published>2012-06-18T11:18:00.000-07:00</published><updated>2012-06-18T11:18:13.004-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="C++ and SDL_Net"/><category scheme="http://www.blogger.com/atom/ns#" term="codeblocks"/><category scheme="http://www.blogger.com/atom/ns#" term="SDL"/><category scheme="http://www.blogger.com/atom/ns#" term="Ubuntu"/><title type='text'>SDL SDL_Net C++ Code:Blocks Ubuntu all set up and ready!!</title><content type='html'>So most of today I have been setting up my Ubuntu work station. Now I have codeblocks working to program in C++ and also got SDL and SDL_net linked up and ready to use.&lt;br /&gt;
&lt;br /&gt;
I thought about creating a tutorial of how to do this but I&#39;m not sure how useful it&#39;d be if I did. If I do get any requests I will create it for sure.&lt;br /&gt;
&lt;br /&gt;
So Now everything is set up I only have one problem which is my tablet will not work on Linux because it is quiet old and only works on windows. To be fair, it&#39;s kind of broken anyway, as in the wire is broken off it so I might just give it away and buy a brand new wireless one. I will have to get one that is pretty big because I like my space :D&lt;br /&gt;
&lt;br /&gt;
I will review some tablets soon and see which one I should get. I also thought about buying another monitor since I am using a netbook and trust me, it is very small, especially for art work and 3D.</content><link rel='replies' type='application/atom+xml' href='http://gamemakersgroup.blogspot.com/feeds/5504477705587960710/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://gamemakersgroup.blogspot.com/2012/06/sdl-sdlnet-c-codeblocks-ubuntu-all-set.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2686707142569253144/posts/default/5504477705587960710'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2686707142569253144/posts/default/5504477705587960710'/><link rel='alternate' type='text/html' href='http://gamemakersgroup.blogspot.com/2012/06/sdl-sdlnet-c-codeblocks-ubuntu-all-set.html' title='SDL SDL_Net C++ Code:Blocks Ubuntu all set up and ready!!'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2686707142569253144.post-5742858199254707017</id><published>2012-06-18T09:29:00.000-07:00</published><updated>2012-06-18T09:29:29.084-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="C++"/><category scheme="http://www.blogger.com/atom/ns#" term="codeblocks"/><category scheme="http://www.blogger.com/atom/ns#" term="Programming"/><category scheme="http://www.blogger.com/atom/ns#" term="Ubuntu"/><title type='text'>Installing Code:Blocks on Ubuntu</title><content type='html'>Okay like I said on my previous post. I am no longer using Windows and am now using Ubuntu.&lt;br /&gt;
&lt;br /&gt;
The thing is, I still want to use my software. I have been using Code:Blocks for a very long time and I wish to continue to use it. So I have decided to install it and show a quick tutorial on how to do so.&lt;br /&gt;
&lt;br /&gt;
Open up the console/terminal from ubuntu and enter the code bellow:&lt;br /&gt;
&lt;br /&gt;
&lt;pre style=&quot;color: red;&quot;&gt;&lt;b&gt;sudo apt-get install build-essential&amp;nbsp;&lt;/b&gt;&lt;/pre&gt;
&lt;pre&gt;&amp;nbsp;&lt;/pre&gt;
now follow the screen, enter your password, and yes to download the package.&lt;br /&gt;
&lt;br /&gt;
&lt;pre style=&quot;color: red;&quot;&gt;&lt;b&gt;sudo apt-get install gdb&lt;/b&gt;&lt;/pre&gt;
&lt;br /&gt;
now do the same for the debugger.&lt;br /&gt;
&lt;br /&gt;
&lt;pre style=&quot;color: red;&quot;&gt;&lt;b&gt;sudo apt-get install libwxgtk2.8-0&lt;/b&gt;&lt;/pre&gt;
&lt;br /&gt;
this is the wxWidgets for handling the applications.&lt;br /&gt;
&lt;div style=&quot;color: red;&quot;&gt;
&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/div&gt;
&lt;pre style=&quot;color: red;&quot;&gt;&lt;b&gt;sudo apt-get install libwxgtk2.8-dev&lt;/b&gt;&lt;/pre&gt;
&lt;br /&gt;
the wxWidgets for developing the applications.&lt;br /&gt;
&lt;br /&gt;
Now go to &lt;a href=&quot;http://www.codeblocks.org/downloads/26#linux&quot;&gt;http://www.codeblocks.org/downloads/26#linux&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
and choose the debian file. (The first from the list. note if you are using a 64-bit, then download the 64-bit one)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Now extract it somewhere you can easily type in. mine was in &lt;b&gt;&lt;span style=&quot;color: lime;&quot;&gt;codeblocks&lt;/span&gt;&lt;/b&gt;. so when I navigate inside the folder, &lt;b&gt;&lt;span style=&quot;color: lime;&quot;&gt;codeblocks/i386&lt;/span&gt;&lt;/b&gt; is where I find the &lt;b style=&quot;color: lime;&quot;&gt;.deb&lt;/b&gt; files.&lt;br /&gt;
&lt;br /&gt;
now type this in&lt;br /&gt;
&lt;br /&gt;
&lt;pre style=&quot;color: red;&quot;&gt;&lt;b&gt;./codeblocks/i386&lt;/b&gt;&lt;/pre&gt;
&lt;br /&gt;
(note, type in the directory where you have the .deb files) then type in&lt;br /&gt;
&lt;div style=&quot;color: red;&quot;&gt;
&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/div&gt;
&lt;pre style=&quot;color: red;&quot;&gt;&lt;b&gt;sudo dpkg -i *.deb&lt;/b&gt;&lt;/pre&gt;
&lt;pre&gt;&amp;nbsp;&lt;/pre&gt;
So now you wait for it to install. There you have it, Code:Blocks installed on Ubuntu. (Note: We no longer are using MinGW so I am not sure if we will be making any changes)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;</content><link rel='replies' type='application/atom+xml' href='http://gamemakersgroup.blogspot.com/feeds/5742858199254707017/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://gamemakersgroup.blogspot.com/2012/06/installing-codeblocks-on-ubuntu.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2686707142569253144/posts/default/5742858199254707017'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2686707142569253144/posts/default/5742858199254707017'/><link rel='alternate' type='text/html' href='http://gamemakersgroup.blogspot.com/2012/06/installing-codeblocks-on-ubuntu.html' title='Installing Code:Blocks on Ubuntu'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2686707142569253144.post-2675275947740598746</id><published>2012-06-17T10:59:00.002-07:00</published><updated>2012-06-17T10:59:20.625-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Blender 2012 Summer Game Competition"/><category scheme="http://www.blogger.com/atom/ns#" term="C++ and SDL_Net"/><title type='text'>Some more updates</title><content type='html'>Yes it&#39;s been a while since I updated here and thought I should write something.&lt;br /&gt;
So what&#39;s new... well I am no longer using Microsoft Windows, I have changed to Linux due to a lot of breakdowns on the Microsoft platform.&lt;br /&gt;
&lt;br /&gt;
The new environment was pretty easy to get used to and not too bad when you know what you are doing. ( I&#39;m using Ubuntu)&lt;br /&gt;
&lt;br /&gt;
So I can still use the program GIMP but I will have to see if my tablet is supported. Lately I haven&#39;t done much drawing at all actually so I will need to do that soon. I have been doing a little research on the Greek Mythology though.&lt;br /&gt;
&lt;br /&gt;
I also have been doing some programming on PHP, very good language.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The next step as for programming, I will be doing a chat system using C++ SDL_Net and blender where you can chat and also move about.</content><link rel='replies' type='application/atom+xml' href='http://gamemakersgroup.blogspot.com/feeds/2675275947740598746/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://gamemakersgroup.blogspot.com/2012/06/some-more-updates.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2686707142569253144/posts/default/2675275947740598746'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2686707142569253144/posts/default/2675275947740598746'/><link rel='alternate' type='text/html' href='http://gamemakersgroup.blogspot.com/2012/06/some-more-updates.html' title='Some more updates'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2686707142569253144.post-7916046286455274564</id><published>2012-05-31T15:10:00.002-07:00</published><updated>2012-06-01T12:50:42.003-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="C++ and SDL_Net"/><category scheme="http://www.blogger.com/atom/ns#" term="python socket"/><category scheme="http://www.blogger.com/atom/ns#" term="Server"/><title type='text'>SDL_Net and C++ server</title><content type='html'>&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiPyGP1yCHlDBzU4-2MYr_1DMsGNJR08QFYknpkYjp5gtV0aFxTErGgHTK1wfi4DWE5o0a9jxrIqaaSDOqbMk836HR-mCjAnsXPN4fucHQaXfsAthD8PKbS-L2Vh2RJ1G0qY6uvX8vUiFYK/s1600/testing.png&quot; imageanchor=&quot;1&quot; style=&quot;clear: right; float: right; margin-bottom: 1em; margin-left: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;300&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiPyGP1yCHlDBzU4-2MYr_1DMsGNJR08QFYknpkYjp5gtV0aFxTErGgHTK1wfi4DWE5o0a9jxrIqaaSDOqbMk836HR-mCjAnsXPN4fucHQaXfsAthD8PKbS-L2Vh2RJ1G0qY6uvX8vUiFYK/s400/testing.png&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;I have made a small tutorial which will give you an overview of how to use SDL_net. Through out the internet, SDL_net isn&#39;t documented very well and it is very hard to know where to get started.&lt;br /&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
In this example, I have made a server in SDL_net and C++ and a test client using python.&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;h2&gt;










So before we start&lt;/h2&gt;
&lt;div&gt;
If you already have SDL_net ready in your C++ environment then skip this section.&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
This example is made using Code::Blocks IDE, in C++ using mingw. If you haven&#39;t set up C++ I suggest you do what I did to get it to work.&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;h4&gt;










The program&lt;/h4&gt;
&lt;div&gt;
I will be using Code::Block IDE. I suggest you download it and installing it&amp;nbsp;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;a href=&quot;http://sourceforge.net/projects/codeblocks/files/Binaries/10.05/Windows/codeblocks-10.05mingw-setup.exe&quot;&gt;http://sourceforge.net/projects/codeblocks/files/Binaries/10.05/Windows/codeblocks-10.05mingw-setup.exe&lt;/a&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;h4&gt;










SDL and SDL_net&lt;/h4&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
You will need both, the SDL and SDL_net files to get everything to work.&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
SDL -&amp;nbsp;&lt;a href=&quot;http://www.libsdl.org/release/SDL-devel-1.2.15-mingw32.tar.gz&quot;&gt;http://www.libsdl.org/release/SDL-devel-1.2.15-mingw32.tar.gz&lt;/a&gt;&lt;/div&gt;
&lt;div&gt;
SDL_net -&amp;nbsp;&lt;a href=&quot;http://www.libsdl.org/projects/SDL_net/release/SDL_net-devel-1.2.8-VC.zip&quot;&gt;http://www.libsdl.org/projects/SDL_net/release/SDL_net-devel-1.2.8-VC.zip&lt;/a&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
Now you will need to unzip them and put the folder in somewhere you will be able to find. I just put them in &lt;span style=&quot;background-color: white;&quot;&gt;&lt;span style=&quot;color: red;&quot;&gt;&lt;b&gt;C:/&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
So I have a folder for&amp;nbsp;&lt;b&gt;&lt;span style=&quot;background-color: white; color: red;&quot;&gt;C:\SDL-1.2.15&lt;/span&gt;&lt;/b&gt; and&lt;span style=&quot;background-color: white; color: red;&quot;&gt;&lt;b&gt;&amp;nbsp;C:\SDL_net-1.2.8&lt;/b&gt;&lt;/span&gt;. This will be easier when you set up your program&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;h4&gt;










Setting up the SDL_net server&lt;/h4&gt;
&lt;div&gt;
Now open up Code::Blocks and start a new project.&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&lt;b style=&quot;background-color: white;&quot;&gt;File&lt;/b&gt;-&amp;gt;&lt;b&gt;New&lt;/b&gt;-&amp;gt;&lt;b&gt;Project&lt;/b&gt;&lt;/blockquote&gt;
From the list choose &quot;&lt;b&gt;Empty project&lt;/b&gt;&quot; and hit go.&lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&lt;b&gt;Next&lt;/b&gt;-&amp;gt; then choose a location and a title for your project.&lt;/blockquote&gt;
&lt;br /&gt;
after this is done. you would of created your first project.&lt;br /&gt;
&lt;br /&gt;
&lt;h4&gt;










Setting up compiler to use SDL_net&lt;/h4&gt;
We will now set up the compiler to use the libraries and include folders.&lt;br /&gt;
&lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&lt;b&gt;Settings&lt;/b&gt;-&amp;gt;&lt;b&gt;Compiler and Debugger&lt;/b&gt;&lt;/blockquote&gt;
go to the linkers settings and click Add.&lt;br /&gt;
&lt;br /&gt;
now locate the directory where you installed SDL. open up the folder called lib and add the file&amp;nbsp;&lt;span style=&quot;color: lime;&quot;&gt;libSDL.dll.a&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&lt;b&gt;&lt;span style=&quot;color: red;&quot;&gt;C:\SDL-1.2.15\lib\libSDL.dll.a&lt;/span&gt;&lt;/b&gt;&lt;/blockquote&gt;
Now do the same again but now locate the file&amp;nbsp;&lt;span style=&quot;color: lime;&quot;&gt;&lt;b&gt;libSDLmain.a&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&lt;b&gt;&lt;span style=&quot;color: red;&quot;&gt;C:\SDL-1.2.15\lib\libSDLmain.a&lt;/span&gt;&lt;/b&gt;&lt;/blockquote&gt;
&lt;br /&gt;
Add again, and this time locate the directory where you installed SDL_net and open up the folder called lib then open up x86 and add &lt;b&gt;&lt;span style=&quot;color: lime;&quot;&gt;SDL_net.lib&amp;nbsp;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&lt;span style=&quot;color: red;&quot;&gt;&lt;b&gt;C:\SDL_net-1.2.8\lib\x86\SDL_net.lib&lt;/b&gt;&lt;/span&gt;&lt;/blockquote&gt;
&lt;br /&gt;
On your right hand side, there is a large box called other linkers options:&lt;br /&gt;
type this inside&lt;br /&gt;
&lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&lt;b&gt;&lt;span style=&quot;color: red;&quot;&gt;-lmingw32&lt;/span&gt;&lt;/b&gt;&lt;/blockquote&gt;
Go to the search directories and under compiler, click add. locate your SDL folder and add the include folder. Do this again and this time add the SDL folder inside the include folder.&lt;br /&gt;
Now go to the SDL_net folder and add the include folder from that.&lt;br /&gt;
&lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&lt;b&gt;&lt;span style=&quot;color: red;&quot;&gt;C:\SDL-1.2.15\include&lt;br /&gt;C:\SDL-1.2.15\include\SDL&lt;br /&gt;C:\SDL_net-1.2.8\include&lt;/span&gt;&lt;/b&gt;&lt;/blockquote&gt;
&lt;br /&gt;
Click save to saves these settings. make sure to save them when exiting the program so you don&#39;t have to do this again.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;h4&gt;










The SDL_net and SDL .dll files&lt;/h4&gt;
&lt;br /&gt;
For your program to work you will need to put the dll files either in your program or in your windows system32 directory or if you are a x64 user&amp;nbsp;&lt;span style=&quot;background-color: #fafafa; color: #333333; font-family: Verdana, Arial, Tahoma, Calibri, Geneva, sans-serif; font-size: 13px;&quot;&gt;C:\Windows\SysWOW64&lt;/span&gt;&lt;span style=&quot;background-color: #fafafa; color: #333333; font-family: Verdana, Arial, Tahoma, Calibri, Geneva, sans-serif; font-size: 13px;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
These files are located in the bin folder for SDL and in the lib folder for SDL_net.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;h2&gt;










The SDL_net Server Tutorial&lt;/h2&gt;
First of all we need a file so that we can start coding.&lt;br /&gt;
&lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&lt;b&gt;File&lt;/b&gt;-&amp;gt;&lt;b&gt;New&lt;/b&gt;-&amp;gt;&lt;b&gt;File&lt;/b&gt;-&amp;gt;and choose &lt;b&gt;C/C++ source&lt;/b&gt;&lt;/blockquote&gt;
Now press&lt;b&gt; Next&lt;/b&gt;, choose&lt;b&gt; C++&lt;/b&gt;, and&lt;b&gt; tick&lt;/b&gt; both &lt;b&gt;Debug&lt;/b&gt; and &lt;b&gt;Release&lt;/b&gt;. Now click the folder opener &lt;b&gt;&quot;...&quot;&lt;/b&gt; and name your file&lt;b&gt; main&lt;/b&gt; and click &lt;b&gt;finish&lt;/b&gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;h4&gt;










The Code&lt;/h4&gt;
&lt;span style=&quot;font-family: monospace;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: monospace;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: monospace;&quot;&gt;#include &quot;SDL_net.h&quot; &lt;span style=&quot;color: #bf9000;&quot;&gt;// This is the SDL_net header file&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: monospace;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: monospace;&quot;&gt;#include &amp;lt;iostream&amp;gt; &lt;span style=&quot;color: #bf9000;&quot;&gt;// This will be used for outputting to the console&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: monospace;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: monospace;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: monospace;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: monospace;&quot;&gt;using namespace std;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: monospace;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: monospace;&quot;&gt;int main(int argc, char *argv[]) &lt;span style=&quot;color: #bf9000;&quot;&gt;// The entry point for the program&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: monospace;&quot;&gt;{&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; freopen(&quot;CON&quot;,&quot;w&quot;,stdout); &lt;span style=&quot;color: #bf9000;&quot;&gt;// This will enable us to write to the console&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: monospace;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; TCPsocket server, client; &lt;span style=&quot;color: #bf9000;&quot;&gt;// TCP sockets. server for listening and client for each client&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: monospace;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; IPaddress ip, *remoteIP; &lt;span style=&quot;color: #bf9000;&quot;&gt;// IPaddress. ip for the server. remoteIP for connected clients.&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: monospace;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; bool quit, quit1; &lt;span style=&quot;color: #bf9000;&quot;&gt;// These boolean objects will be used for looping&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; char buffer[512]; &lt;span style=&quot;color: #bf9000;&quot;&gt;// Holds the message&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: monospace;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: monospace;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; if(SDLNet_Init() &amp;lt; 0) &lt;span style=&quot;color: #bf9000;&quot;&gt;// Initialize SDL_net&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; {&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; cout &amp;lt;&amp;lt; &quot;SDLNet_Init: &quot; &amp;lt;&amp;lt; SDLNet_GetError() &amp;lt;&amp;lt; endl;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; return 0;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; cout &amp;lt;&amp;lt; &quot;Server Initialized....\n&quot;; &lt;span style=&quot;color: #bf9000;&quot;&gt;// Print out that the server initialized&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: monospace;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; if(SDLNet_ResolveHost(&amp;amp;ip,0,1993) &amp;lt; 0) &lt;span style=&quot;color: #bf9000;&quot;&gt;// Resolve host to set up the server. The ip is so that it can use the local host, 0 meaning it is the server and 1993 is a port I chose.&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; {&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; cout &amp;lt;&amp;lt; &quot;SDLNet_ResolveHost: &quot; &amp;lt;&amp;lt; SDLNet_GetError() &amp;lt;&amp;lt; endl;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; return 0;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: monospace;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; if(!(server=SDLNet_TCP_Open(&amp;amp;ip))) &lt;span style=&quot;color: #bf9000;&quot;&gt;// We will set up a new TCP socket for listening.&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; {&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; cout &amp;lt;&amp;lt; &quot;SDLNet_TCP_Open: &quot; &amp;lt;&amp;lt; SDLNet_GetError() &amp;lt;&amp;lt; endl;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; return 0;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; quit = false; &lt;span style=&quot;color: #bf9000;&quot;&gt;// quit is set to false so we can loop&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: monospace;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; while(!quit) &lt;span style=&quot;color: #bf9000;&quot;&gt;// Enter the loop&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; {&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;if((client = SDLNet_TCP_Accept(server))) &lt;span style=&quot;color: #bf9000;&quot;&gt;// If there is a client, accept it and assign it to client&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;{&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;if((remoteIP = SDLNet_TCP_GetPeerAddress(client))) &lt;span style=&quot;color: #bf9000;&quot;&gt;// if we are able to get the address of the client, put it in remoteIP&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;{&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;cout &amp;lt;&amp;lt; &quot;Host Connected: &quot; &amp;lt;&amp;lt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;SDLNet_Read32(&amp;amp;remoteIP-&amp;gt;host) &amp;lt;&amp;lt; &quot; &quot; &amp;lt;&amp;lt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;SDLNet_Read16(&amp;amp;remoteIP-&amp;gt;port) &amp;lt;&amp;lt; endl; &lt;span style=&quot;color: #bf9000;&quot;&gt;// output the information of the host.&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;}&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;else &lt;span style=&quot;color: #bf9000;&quot;&gt;// if we cannot accept, then we output an error.&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;{&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;cout &amp;lt;&amp;lt; &quot;SDLNet_TCP_Accept: &quot; &amp;lt;&amp;lt; SDLNet_GetError() &amp;lt;&amp;lt; endl;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;}&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;quit1 = false;&lt;span style=&quot;color: #bf9000;&quot;&gt; // set quit1 to false for second loop&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;while(!quit1) &lt;span style=&quot;color: #bf9000;&quot;&gt;// second loop starts&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;{&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;memset(buffer, 0, sizeof(buffer)); &lt;span style=&quot;color: #bf9000;&quot;&gt;// Empty out the buffer&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;if(SDLNet_TCP_Recv(client, buffer, 512)&amp;gt;0) &lt;span style=&quot;color: #bf9000;&quot;&gt;// If we receive something from client and it isn&#39;t and error, put it in buffer.&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;{&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;cout &amp;lt;&amp;lt; &quot;client says: &quot; &amp;lt;&amp;lt; buffer &amp;lt;&amp;lt; endl; &lt;span style=&quot;color: #bf9000;&quot;&gt;// output the message&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;if(strcmp(buffer, &quot;exit\0&quot;) == 0) &lt;span style=&quot;color: #bf9000;&quot;&gt;// if the message says exit, we exit this loop&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;{&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;quit1 = true;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;cout &amp;lt;&amp;lt; &quot;Terminating connection&quot; &amp;lt;&amp;lt; endl;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;}&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;if(strcmp(buffer,&quot;shutdown\0&quot;) == 0) &lt;span style=&quot;color: #bf9000;&quot;&gt;// if the messages says shutdown, we exit both loops, meaning we end the program&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;{&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;quit1 = true;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;quit = true;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;cout &amp;lt;&amp;lt; &quot;quiting program&quot; &amp;lt;&amp;lt; endl;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;}&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;}&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;else &lt;span style=&quot;color: #bf9000;&quot;&gt;// if the message receive is 0 or less, meaning there is an error or the connection is lost, we end this loop.&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;{&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: monospace;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; quit1 = true;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; cout &amp;lt;&amp;lt; &quot;Terminating connection&quot; &amp;lt;&amp;lt; endl;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;}&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;}&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;SDLNet_TCP_Close(client); &lt;span style=&quot;color: #bf9000;&quot;&gt;// close the client socket&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;}&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; SDLNet_TCP_Close(server); &lt;span style=&quot;color: #bf9000;&quot;&gt;// close the server socket&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; SDLNet_Quit(); &lt;span style=&quot;color: #bf9000;&quot;&gt;// quit SDL_net&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: monospace;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: monospace;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; return 0; &lt;span style=&quot;color: #bf9000;&quot;&gt;// return 0 meaning everything worked just fine&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: monospace;&quot;&gt;}&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: monospace;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
you can copy and paste this code or you can write it out. the comments are just there to explain the program.&lt;br /&gt;
&lt;br /&gt;
&lt;h2&gt;






Python Socket client&lt;/h2&gt;
I have decided to use python for creating the client because I wanted a client with easy input and minimum code.&lt;br /&gt;
&lt;br /&gt;
If you would like to use python for your client too then follow these steps.&lt;br /&gt;
&lt;br /&gt;
You will need to download python 3.2 or later.&amp;nbsp;&lt;a href=&quot;http://www.python.org/getit/&quot;&gt;http://www.python.org/getit/&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
After you installed it, open up a notepad and save is as &lt;b&gt;client.py&lt;/b&gt;&lt;br /&gt;
Make sure it isn&#39;t saved as .txt file&lt;br /&gt;
&lt;br /&gt;
Now simply type in this code and save it:&lt;br /&gt;
&lt;br /&gt;
&lt;code&gt;&lt;span style=&quot;color: #bf9000;&quot;&gt;#import the socket library&lt;/span&gt;&lt;/code&gt;&lt;br /&gt;
&lt;code&gt;from socket import *&lt;/code&gt;&lt;br /&gt;
&lt;code&gt;&lt;br /&gt;&lt;/code&gt;&lt;br /&gt;
&lt;code&gt;&lt;span style=&quot;color: #bf9000;&quot;&gt;#set up a TCP socket named server&lt;/span&gt;&lt;/code&gt;&lt;br /&gt;
&lt;code&gt;server = socket(AF_INET, SOCK_STREAM)&amp;nbsp;&lt;/code&gt;&lt;br /&gt;
&lt;code&gt;&lt;br /&gt;&lt;/code&gt;&lt;br /&gt;
&lt;code&gt;&lt;span style=&quot;color: #bf9000;&quot;&gt;#connect to server using the ip &quot;127.0.0.1&quot; (or &quot;localhost&quot;) and port 1993 like the server&lt;/span&gt;&lt;/code&gt;&lt;br /&gt;
&lt;code&gt;server.connect((&quot;127.0.0.1&quot;, 1993))&amp;nbsp;&lt;/code&gt;&lt;br /&gt;
&lt;code&gt;&lt;br /&gt;&lt;/code&gt;&lt;br /&gt;
&lt;code&gt;&lt;br /&gt;&lt;/code&gt;&lt;br /&gt;
&lt;code&gt;&lt;span style=&quot;color: #bf9000;&quot;&gt;#start a loop&lt;/span&gt;&lt;/code&gt;&lt;br /&gt;
&lt;code&gt;while True:&amp;nbsp;&lt;/code&gt;&lt;br /&gt;
&lt;code&gt;&amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #bf9000;&quot;&gt;#input allow the user to input something to the variable data&lt;/span&gt;&lt;/code&gt;&lt;br /&gt;
&lt;code&gt;&amp;nbsp; &amp;nbsp; data = input(&quot;--&amp;gt;&quot;)&amp;nbsp;&lt;/code&gt;&lt;br /&gt;
&lt;code&gt;&amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #bf9000;&quot;&gt;#convert these strings to bytes with UTF-8 encoding&lt;/span&gt;&lt;/code&gt;&lt;br /&gt;
&lt;code&gt;&amp;nbsp; &amp;nbsp; data = bytes(data,&quot;UTF-8&quot;)&lt;/code&gt;&lt;br /&gt;
&lt;code&gt;&amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #bf9000;&quot;&gt;#send the data to the server&lt;/span&gt;&lt;/code&gt;&lt;br /&gt;
&lt;code&gt;&amp;nbsp; &amp;nbsp; server.send(data)&lt;/code&gt;
&lt;br /&gt;
&lt;br /&gt;
Now to run this file, just double click it. Make sure the server is running already before running the client. This client is simple and when you want to exit, you just close it.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;h2&gt;


Conclusion&lt;/h2&gt;
So this is a very basic server created using C++ and SDL_net library. In here, I introduced many simple and useful things that you will need such as using freopen to opening the console. This is useful to use with stuff you already know such as cout and cin. I also introduced memset which empties out the array which without this, we will constantly get garbage data and the program wouldn&#39;t run properly.&lt;br /&gt;
&lt;br /&gt;
I will mostly likely do a client in C++ and SDL_net next time and also will carry on doing more tutorials like these for networking.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: red;&quot;&gt;If you have and problems or any questions talk to me on the forum&amp;nbsp;&lt;/span&gt;&lt;/b&gt;&lt;a href=&quot;http://gamemakergroup.webs.com/&quot;&gt;http://gamemakergroup.webs.com/&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
and just remember to run the server before you run the client ;)</content><link rel='replies' type='application/atom+xml' href='http://gamemakersgroup.blogspot.com/feeds/7916046286455274564/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://gamemakersgroup.blogspot.com/2012/05/sdlnet-and-c-server.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2686707142569253144/posts/default/7916046286455274564'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2686707142569253144/posts/default/7916046286455274564'/><link rel='alternate' type='text/html' href='http://gamemakersgroup.blogspot.com/2012/05/sdlnet-and-c-server.html' title='SDL_Net and C++ server'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiPyGP1yCHlDBzU4-2MYr_1DMsGNJR08QFYknpkYjp5gtV0aFxTErGgHTK1wfi4DWE5o0a9jxrIqaaSDOqbMk836HR-mCjAnsXPN4fucHQaXfsAthD8PKbS-L2Vh2RJ1G0qY6uvX8vUiFYK/s72-c/testing.png" height="72" width="72"/><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2686707142569253144.post-4661191183250367234</id><published>2012-05-30T08:31:00.001-07:00</published><updated>2012-05-30T08:31:57.924-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="C++ and SDL_Net"/><title type='text'>C++ and SDL_Net Tutorial</title><content type='html'>When I started dabbing in network programming for making online games. SDL_Net was a library that look neat for me to work with. Since I was also using SDL for graphics, I thought it would be easy to use that.&lt;br /&gt;
&lt;br /&gt;
But like everyone knows, there are hardly any tutorials to use for using SDL_Net with C++. Well I had to learn the hard way and sometime next week, I am going to write a tutorial to get you started with SDL_Net and show you how everything works. Stay Tuned!</content><link rel='replies' type='application/atom+xml' href='http://gamemakersgroup.blogspot.com/feeds/4661191183250367234/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://gamemakersgroup.blogspot.com/2012/05/c-and-sdlnet-tutorial.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2686707142569253144/posts/default/4661191183250367234'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2686707142569253144/posts/default/4661191183250367234'/><link rel='alternate' type='text/html' href='http://gamemakersgroup.blogspot.com/2012/05/c-and-sdlnet-tutorial.html' title='C++ and SDL_Net Tutorial'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry></feed>