straightliner

Awards

Give this entry an award

Diary Entries

straightliner, 6 days, 18 hours, 56 minutes

When I first saw it was Wibbly-wobbly I didn't know what to do, since it was my lowest choice in a bunch of themes that I didn't know what to do with! But after some house chores and sketching I think I have something. 




I'm trying to fulfill my secret wish to make cool arcade games. 
 
* you are the ball
* your ball runs on the lines. Kind of like marble madness you have to stay straight on the lines to survive. You course correct with the left/right arrows.
* the level will wobble, moving the ball (God I hope I can get OpenGL to do that!). 
* if you hit triangles, you die.
* if you're charged up with energy points, you kill triangles for points. 
* it speeds up the longer you last.

OK, bedtime. 

Add a comment

straightliner, 5 days, 20 hours, 44 minutes




This is me diving into the depths of OpenGL (literally and figuratively). One of the reasons I started using pyglet was to get into learning OpenGL, so I'm trying to break the 2D plane I've been in up to now, 

That screen looks a little weird (well to be honest I kind of like it) because I'm rotating sprites about a ridiculous vector. I realized today I made a pretty glaring beginner mistake -- if I want to tilt the plane of my 2D sprites, I'm probably not going to be able to see them anymore! 

I don't quite know what to do about this yet, whether there's still a solution using 2D sprites, or if I need 3D sprites. I'll look into this tomorrow. My fall back plan is to wibble and wobble the plane in 2D only. My ideal is to really tilt the plane in 3D...I wonder how easy it would be to create 3D sprites from the 2D PNGs I've already made? A workable alternative would be to tilt the perspective only, so you're still looking at the 2D plane but not straight down on it, but I don't know if that's possible or if I'm even thinking of that correctly. 
I'm guessing not given my experiments today.

In any case, I have very simple level loading, a player (the circle) and enemies (the...enemy looking things) and stars the player can pick up. Everything is monochrome when loaded, I'll add hue to sprites at run-time as part of the gameplay. 

Arrow keys move the player, but falling off the rails is death (it'd be neat to have the player plunge into the z-depths if I can manage that with a GL perspective). 

 

3 comments

straightliner, 4 days, 22 hours, 24 minutes

Well thanks to the suggestions on the pyglet mailing list and in the comments here, I think I got the effects I want with OpenGL, as well as some extra effects that are suggesting themselves as I play around with the functions. This will be a rather minor accomplishment compared to say, Crysis, but a rather extreme one compared to my previous undertakings, so I'm pretty happy!

The game is turning into kind of a cross between Pac-Man and 2D Marble Madness. Up next for tomorrow is figuring out a good way to test the player's position against the track so that you fall off if you stray too far from the rails. It's just a top-down tile map so this shouldn't be too bad. Then I should have a basically winnable and losable level, after that I need more stuff, and especially sound, and everything else. Very detailed I know. 

I'm taking a different approach from the last compo I was in (the 7DRL a couple of weeks ago, where I thought I was designing a space shuttle or something) and not spending much time on structuring the code. I'm probably swinging a little bit too far in the opposite direction here, but it's working out OK so far. However for laughs and the sake of posterity I want to post my current level-loading class:


def __init__(self):
    for file in os.listdir('data/levels'):
        with open('data/levels/' + file) as f:
            d = f.readlines()
            d = [line.strip().split(' ') for line in d if not line.startswith('#')]
            dx = [[LEVEL_KEY[t[0:2]] for t in row] for row in d]
            dx = [
                [(t, images.__dict__[t], x*TILE, W_H-TILE-y*TILE) for x, t in enumerate(row)]
                 for y, row in enumerate(dx)]
            dx = [[CustomSprite(*data, batch=batch, group=tile_group) for data in row] for row in dx]
            self.__dict__[file] = dx

            d = [[LEVEL_KEY.get(s[2:3], None) for s in row ] for row in d]
            d = [
                [(s, images.__dict__[s], x*TILE, W_H-TILE-y*TILE) for x, s in enumerate(row) if not s == None]
                 for y, row in enumerate(d)]
            d = [[CustomSprite(*data, batch=batch, group=sprite_group) for data in row] for row in d if row]
            d = [item for sublist in d for item in sublist]  
            self.__dict__[file + '_sprites'] = d

            for item in d:
                if item.kind == 'player':                    
                    self.player = item 
 



Yes...I did say I was maybe going too far in the opposite direction, right?

4 comments

straightliner, 5 hours, 33 minutes

Well, I ran out of steam on this one. I actually had some extra time this week from work too, I guess I just wasn't that into the game. Try again next time!

Add a comment