Show us yer programming projects!

Coders forum. Discuss techniques, swap code snippets, ask for help etc. relating to all forms of software development.
Post Reply
User avatar
Space Cowboy
Baaaaaa!
Baaaaaa!
Posts: 2837
Joined: Wed Apr 30, 2003 7:17 pm 0
Yahoo Messenger: space_covvboy
Contact:

Re: Show us yer programming projects!

Post by Space Cowboy »

I've just gone and bought Titan Attacks on Steam, and, wow ... it is incredibly addictive. Love it, pathetic scores at the moment and there are some hard bastard invader movement patterns in there, but I love it. Great stuff.
“I contend that for a nation to try to tax itself into prosperity is like a man standing in a bucket and trying to lift himself up by the handle.” - Winston Churchill
User avatar
PaulCunningham
Baaaaa!
Baaaaa!
Posts: 1218
Joined: Sun Jan 18, 2004 11:47 pm 0
Location: Walsall, England
Contact:

Re: Show us yer programming projects!

Post by PaulCunningham »

Checkout Revenge of the Titans too :-)

Droid Assault and Ultratron should be making their way to Steam as well in the not too distant future (hopefully).
Cheers,
Paul Cunningham
Pumpkin Games
User avatar
Space Cowboy
Baaaaaa!
Baaaaaa!
Posts: 2837
Joined: Wed Apr 30, 2003 7:17 pm 0
Yahoo Messenger: space_covvboy
Contact:

Re: Show us yer programming projects!

Post by Space Cowboy »

I've already got Revent of the Titans; I think I downloaded the demo - you may even have sent it to me - and off the back of that I got it from Steam.

Keep up the fine work! :)
“I contend that for a nation to try to tax itself into prosperity is like a man standing in a bucket and trying to lift himself up by the handle.” - Winston Churchill
User avatar
PaulCunningham
Baaaaa!
Baaaaa!
Posts: 1218
Joined: Sun Jan 18, 2004 11:47 pm 0
Location: Walsall, England
Contact:

Re: Show us yer programming projects!

Post by PaulCunningham »

Ha, nowt to do with me, unfortunately :-) It's Cas Prince and Chaz Willets that do all the real work (I just do a bit of conversion stuff every now and then)
Cheers,
Paul Cunningham
Pumpkin Games
User avatar
Space Cowboy
Baaaaaa!
Baaaaaa!
Posts: 2837
Joined: Wed Apr 30, 2003 7:17 pm 0
Yahoo Messenger: space_covvboy
Contact:

Re: Show us yer programming projects!

Post by Space Cowboy »

Revent of the Titans? Revent? Sheesh. It's been a long day.
“I contend that for a nation to try to tax itself into prosperity is like a man standing in a bucket and trying to lift himself up by the handle.” - Winston Churchill
User avatar
failrate
Baaaaaa!
Baaaaaa!
Posts: 2354
Joined: Sun May 23, 2004 6:54 am 0
Location: Sandy Eggo
Contact:

Re: Show us yer programming projects!

Post by failrate »

Just got done with a new flash game with my homegrown engine. A little bit of fun: http://www.newgrounds.com/portal/view/592896
User avatar
pogo
Sheepie Whore
Sheepie Whore
Posts: 14180
Joined: Tue Sep 10, 2002 8:28 pm 0
Yahoo Messenger: BrassSparrow
Location: County Durham

Re: Show us yer programming projects!

Post by pogo »

failrate, I'm seeing errors in the Flash Debug Player. One on the start screen

Code: Select all

ReferenceError: Error #1069: Property Thrust not found on SoundLibrary and there is no default value.
	at SoundManager/cancelSound()
	at GameClient/inputUpResponse()
	at GameClient/mouseUpEventResponse()
And then when I click when playing

Code: Select all

ReferenceError: Error #1069: Property Thrust not found on SoundLibrary and there is no default value.
	at SoundManager/triggerSound()
	at MethodInfo-38()
	at State/input()
	at StateManager/input()
	at GameClient/action()
	at GameClient/inputDownResponse()
	at GameClient/mouseDownEventResponse()
after which the first error reoccurs. It still runs but will not be running code after the above error so may be missing functionality. Flash Player 11.2 debug, Safari and OS X.
User avatar
failrate
Baaaaaa!
Baaaaaa!
Posts: 2354
Joined: Sun May 23, 2004 6:54 am 0
Location: Sandy Eggo
Contact:

Re: Show us yer programming projects!

Post by failrate »

Thanks, pogo. Fixed it :)
User avatar
sdetoni
Baaaaa!
Baaaaa!
Posts: 1368
Joined: Tue Jun 18, 2002 4:14 am 0
Location: New Sheepland

Re: Show us yer programming projects!

Post by sdetoni »

Getting to know Python, quirky language, not broken like Perl.
Tried getting to know Ruby, but the language wants you to assume too much about some of its
hidden structure and data ... this will equate to WTF when trying to debug code ... I don't I want to like Ruby.
Spoiler: show

Code: Select all

import sys
import math
import pygame

# Magic numbers
radians2Degrees = 57.2957795
width           = 1024
height          = 768
window          = pygame.display.set_mode((width, height))
pygame.display.set_caption("Koch's Curve :: Left/Right = depth : Up/Down = segments")

def KochSegment (window, x1, y1, x2, y2, depth):
            
    xLen = abs (x1-x2)
    xSeg = xLen / 3
    yLen = abs (y1-y2)
    ySeg = yLen / 3
    
    if ((xLen == 0) and (yLen == 0)):
        return

    xPlot1, xPlot2, yPlot1, yPlot2, xMid, yMid, xNew, yNew = 0,0,0,0,0,0,0,0
    
    if (x1 > x2):
        xPlot1 = x1 - xSeg
        xPlot2 = x1 - (xSeg * 2)            
    else:
        xPlot1 = x1 + xSeg
        xPlot2 = x1 + (xSeg * 2)

    if (y1 > y2):        
        yPlot1 = y1 - ySeg                
        yPlot2 = y1 - (ySeg * 2)        
    else:   
        yPlot1 = y1 + ySeg
        yPlot2 = y1 + (ySeg * 2)

    newSegLen = math.sqrt( (abs (xPlot1-xPlot2)*abs (xPlot1-xPlot2)) + (abs (yPlot1-yPlot2)*abs (yPlot1-yPlot2)) )
        
    if (x1 > x2):
        xMid = x1 - (xLen/2)
    else:
        xMid = x1 + (xLen/2)
        
    if (y1 > y2):    
        yMid = y1 - (yLen/2)        
    else:        
        yMid = y1 + (yLen/2)

    # Determine the angle between the 2 starting points.
    if (xLen == 0):
        angle = abs(math.atan(xLen / yLen) * radians2Degrees) % 90 # turn it into degrees
    else:                
        angle = abs(math.atan(yLen / xLen) * radians2Degrees) % 90 # turn it into degrees    
    newAngle = ((90 - angle) / radians2Degrees) # turn it into radians
     
    if (x1 >= x2) and (y1 >= y2):
        xNew = xMid - (math.cos(newAngle) * newSegLen)
        yNew = yMid + (math.sin(newAngle) * newSegLen)
    elif (x1 > x2) and (y1 < y2):
        xNew = xMid + (math.cos(newAngle) * newSegLen)
        yNew = yMid + (math.sin(newAngle) * newSegLen)            
    elif (x1 < x2) and (y1 < y2):
        xNew = xMid + (math.cos(newAngle) * newSegLen)
        yNew = yMid - (math.sin(newAngle) * newSegLen)
    else:
        xNew = xMid - (math.cos(newAngle) * newSegLen)
        yNew = yMid - (math.sin(newAngle) * newSegLen)
                                    
    if (depth <= 0):

        pygame.draw.line(window,  (0, 255, 0), 
                        (x1, y1), 
                        (xPlot1, yPlot1));
             
        pygame.draw.line(window,  (0, 0, 255), 
                    (xPlot2, yPlot2), 
                    (x2, y2));
                
        pygame.draw.line(window,  (255, 0, 0), 
                        (xPlot1, yPlot1), 
                        (xNew, yNew));
    
        pygame.draw.line(window,  (255, 0, 255), 
                        (xNew, yNew), 
                        (xPlot2, yPlot2));                    
    else:
        KochSegment (window, x1,     y1,     xPlot1, yPlot1, depth-1)
        KochSegment (window, xPlot1, yPlot1, xNew,   yNew,   depth-1)
        KochSegment (window, xNew,   yNew,   xPlot2, yPlot2, depth-1)
        KochSegment (window, xPlot2, yPlot2, x2,     y2,     depth-1)

# ------------------------------------------------

def KochCurve (window, xStart, yStart, radius, segNum, depth):
    segStep  = (360 / segNum) 
    count    = segNum + 1
        
    lastXPlot = 0
    lastYPlot = 0
    angle     = 0
    while (count > 0):
        if (angle <= 0):
            lastXPlot = xStart  + (radius * math.cos (angle / radians2Degrees))
            lastYPlot = yStart - (radius * math.sin (angle / radians2Degrees))
        else:
            newXPlot = xStart  + (radius * math.cos (angle / radians2Degrees))
            newYPlot = yStart - (radius * math.sin (angle / radians2Degrees))
            
            KochSegment (window,                     
                         newXPlot,  newYPlot,
                         lastXPlot, lastYPlot,            
                         depth)
            lastXPlot = newXPlot
            lastYPlot = newYPlot
            
        angle = angle + segStep
        count = count -1
        pass    

# ------------------------------------------------

pygame.init()

# More magic numbers
depth    = 6
segments = 3 
        
KochCurve (window, width/2, height/2, width/4, segments, depth);
pygame.display.flip() #draw it to the screen 
        
#input handling (somewhat boilerplate code):
while True:      
    for event in pygame.event.get():
        update = False
        key = pygame.key.get_pressed()        
        if event.type == pygame.QUIT: 
            sys.exit(0)
        # Change segments 
        elif key[pygame.K_UP]:
            segments = segments + 1
            update = True
        elif key[pygame.K_DOWN]:
            if (segments > 2):
                segments = segments - 1
                update = True
        elif key[pygame.K_LEFT]:
            if (depth > 1):
                depth = depth - 1
                update = True
        elif key[pygame.K_RIGHT]:
            depth = depth + 1
            update = True 
        else: 
            pass # print (event) 
            
        if (update != False):
            window.fill((0, 0, 0))
            
            KochCurve (window, width/2, height/2, width/4, segments, depth);
            pygame.display.flip() #draw it to the screen                     
User avatar
tufty
Sheepie Whore
Sheepie Whore
Posts: 12524
Joined: Fri Jan 07, 2005 4:52 pm 0
Location: French Alps

Re: Show us yer programming projects!

Post by tufty »

sdetoni wrote:Tried getting to know Ruby, but the language wants you to assume too much about some of its
hidden structure and data ... this will equate to WTF when trying to debug code
That's an interesting assertion, and not something I'd (consciously) noticed myself. Could you expand on it a bit?
"massive retard™", "full of shit™", "tiny bitch™", "retarted™", "a bit of a one trick pony™", "petty™", "simple minded idealistic twat™", "miserable humourless fucker™"
User avatar
Orangy Tang
Baaaaa!
Baaaaa!
Posts: 1794
Joined: Sun Apr 25, 2004 5:25 pm 0
Location: My secret lab
Contact:

Re: Show us yer programming projects!

Post by Orangy Tang »

tufty wrote:
sdetoni wrote:Tried getting to know Ruby, but the language wants you to assume too much about some of its
hidden structure and data ... this will equate to WTF when trying to debug code
That's an interesting assertion, and not something I'd (consciously) noticed myself. Could you expand on it a bit?
Yes, of my various complaints about Ruby (which I mostly quite like) that's definitely not what I've found. I still prefer it to Python though, mostly because Python's legacy means all the libraries are horribly inconsistent.

Now Rails, that definitely assumes you know how all it's internals work, and as a result feels a bit like it's held together with sticky tape.
[ Triangular Pixels.net - play Snowman Village, Rescue Squad, NiGHTS 4k and more ] [ Development Journal ]
User avatar
sdetoni
Baaaaa!
Baaaaa!
Posts: 1368
Joined: Tue Jun 18, 2002 4:14 am 0
Location: New Sheepland

Re: Show us yer programming projects!

Post by sdetoni »

Orangy Tang wrote:
tufty wrote:
sdetoni wrote:Tried getting to know Ruby, but the language wants you to assume too much about some of its
hidden structure and data ... this will equate to WTF when trying to debug code
That's an interesting assertion, and not something I'd (consciously) noticed myself. Could you expand on it a bit?
Yes, of my various complaints about Ruby (which I mostly quite like) that's definitely not what I've found. I still prefer it to Python though, mostly because Python's legacy means all the libraries are horribly inconsistent.

Now Rails, that definitely assumes you know how all it's internals work, and as a result feels a bit like it's held together with sticky tape.
It was trying to understand rails at the time, and thought if this Ruby then no thanks.
User avatar
failrate
Baaaaaa!
Baaaaaa!
Posts: 2354
Joined: Sun May 23, 2004 6:54 am 0
Location: Sandy Eggo
Contact:

Re: Show us yer programming projects!

Post by failrate »

Rails ain't Ruby. If you hate Perl, but still want a language that you can use for lots of quick and dirty scripting with an easy to use regex builtin, then Ruby does a good job of that.
adam
Baaaaaa!
Baaaaaa!
Posts: 4418
Joined: Sat Jun 24, 2006 9:15 pm 0

Re: Show us yer programming projects!

Post by adam »

User avatar
Orangy Tang
Baaaaa!
Baaaaa!
Posts: 1794
Joined: Sun Apr 25, 2004 5:25 pm 0
Location: My secret lab
Contact:

Re: Show us yer programming projects!

Post by Orangy Tang »

adam wrote:http://yobriefca.se/blog/2012/04/03/rails-is-not-a-gateway-drug/

a blog post which is in agreeance
Oh, I'd completely forgotten about the Rails approach of "convention over configuration".

Because when I hear a Rails person talk about "convention over configuration", all I hear is "we're too lazy to make things properly configurable, so we hard-coded all the paths and settings". Which leaves you screwed when you want to organise things differently.

Sensible defaults would work just as well, but wouldn't be teeth-gnashingly frustrating to work with. And given Rail's love of auto-generated boilerplate code a default config file could be generated trivially. And that'd have the handy side effect of actually *documenting* the various defaults and conventions, rather than the undocumented mess of assumptions it is right now.

Rails is an interesting experiment, but I'd never use it for any proper work.

</rant>
[ Triangular Pixels.net - play Snowman Village, Rescue Squad, NiGHTS 4k and more ] [ Development Journal ]
Post Reply