Fork me on GitHub

SneakyInput: A Virtual Joypad For iOS

Posted on Thursday, February 2, 2012
Written by

SneakyInput has very nice joystick controls, it’s simple to use and very popular in the Cocos2d community. The source for SneakyInput can be found on github http://github.com/sneakyness/SneakyInput.

My main goal here was to create a CCLayer class that I could include in my game scene.

First Step – Create A CCLayer Class

First we create a CCLayer with some SneakyInput objects and synthesized the objects so that we can access them from the parent layer.

import "cocos2d.h"
import "SneakyJoystick.h"
import "SneakyButton.h"
import "SneakyButtonSkinnedBase.h"
import "SneakyJoystickSkinnedBase.h"

@interface MyJoystick : CCLayer {
SneakyJoystick *leftJoystick;
  SneakyButton *jumpButton;
  SneakyButton *attackButton;
}

Read full article here >>

Amazon Contextual Ads

Posted on Friday, September 23, 2011
Written by

I am doing a site redesign and decided to use contextual ads from Amazon.com and frankly the ad content sucks! I am not pleased with it at all. It’s very disappointing.

I kind of want to give Amazon more time to learn the content on my site, but I have serious doubts that will help.

I have a much better idea on how to get quality and relevant ad content from Amazon. As usual roll your my solution!!!

LineReceiver Protocol In Twisted

Posted on Thursday, September 22, 2011
Written by

Basic Line Receiver

    from twisted.internet import protocol, reactor
    from twisted.protocols import basic</p>

<pre><code>class LineProtocol(basic.LineReceiver):

  def lineReceived(self, line):
    self.transport.write('You sent me this: '+line)
    self.transport.loseConnection()

class LineFactory(protocol.ServerFactory):
  protocol = LineProtocol

reactor.listenTCP(8001), LineFactory())
reactor.run()

Read full article here >>

Python Twisted Client

Posted on Thursday, September 22, 2011
Written by

Interface Of The Protocol Class

While investigating the possible uses for the Twisted Networking Engine, I found it hard to find examples that describe the Interface of the Protocol class. So, I will share this brief code snippet with you.

Protocol Class

A Protocol class can have the following methods for event-driven TCP connections:


MyProtocol(Protocol):         

  def makeConnection(self, transport):
    ''' code '''         

  def connectionMade(self):
    ''' code '''

  def dataReceived(self, data):
    '''' code ''''

  def connectionLost(self, reason):
    ''' code '''
  

Read full article here >>