Posts Tagged ‘library’
Particle48
Hey ludumers!
After watching Martin Jonasson & Petri Purho’s video a while ago, I learned 2 things :
- this “juicyness’ thing that these guys talk about actually exists and works
- particle systems are indeed fun to program!
Now think about it: adding particles and effects to a game is a really cheap trick you can do to make the game look and feel more lively, reactive and spectacular. Particles don’t really interact with anything existing in the game, they just spawn, live their glittery short life and die. It’s very easy to just plug in particle emitters in a almost finished game, set up some emitters and triggers and watch everything explode/sparkle.
With that in mind, I put together a particle system library in JavaScript that renders awesome particles on an HTML5 canvas. Since I’ve created it for an LD event, I named the library Particle48. I intend to use it in every game I’m going to make for LD and I thought I could share it with whomever is interested. Here’s the project on github and a demo – I wish this to become a collaborative work.
Here’s a screenshot, but bear in mind that screenshots don’t always do justice…
What To Stub?
Monday, December 10th, 2012 1:10 pmGetting ready for LD25. I’m using GameMaker again for this one.
Most of my GM projects tend to have some similar things in them. In order to get something more out of my LD experience, I don’t want to continually re-write the same sort of code from scratch with each project.
Compo rules say that you can use “all publicly available libraries and middleware”, so I’m considering bundling up some useful things and creating a “stub project”, that will be like the equivalent of library/middleware in GameMaker-speak, so that I don’t waste precious minutes during the compo writing the same sort of code I always write in any GameMaker game, and can put as much of my 48hrs into creativity and design. Conveniently, this will also serve as my Warmup project this time around. Now, granted, I can only get some much done in the next couple days leading up to LD25, but over time if I continue to maintain this project it could turn into something pretty cool.
I’ll probably maintain this and add to it for future LD48 (and other game jams). So my first question is: What to throw into this thing?
Some thoughts:
- A system of rooms that provides a generic Title Screen, Instructions Screen, and Game World, along with navigational objects and such that switch between them.
- Scripts for handling keyboard input (or other controls, such as mouse or gamepad or whatever).
- Handy math functions that aren’t built into GameMaker already (such as ???)
- A hierarchy of pseudo-abstract classes to facilitate implementation of common design patterns for Player, Enemy, Terrain, and Pickup objects. For example, a common way of implementing a Player is to have a parent Player object, and separate objects for the Player_dead, Player_hurt, and other states. These would be empty, or mostly-empty, to facilitate development of *whatever* type of game you wanted to make with GameMaker, but would help by providing a little bit of structure to the project.
- Code that supports cool visual effects (as I come up with them, over time), such as motion blur, typewriter text, or who knows what.
- “Engine” code for platforms, physics, or whatever.
- I’m open to ideas.
What would you like to see? Drop a comment, be specific.
Consolator 2.10.21
Looking for a Console for your Flash game? I’m currently developing Consolator, a simple library which attachs a console to your project, ready to use and fully customizable.
You can use it to debug your variables, or change your game while playing. You can easily call the methods of the objects you bind.
- Categories of messages, you can hide what you don’t want to see.
- Bind any class and you can automatically access its public methods.
- Visual auto-completion with a popup, just like an IDE would.
- Easy integration: just addChild(new Consolator());
- Fully customizable: change color, background, position, size, etc.
- Remember the last commands used so you don’t have to write them again.
Your ideas are welcome at consolator.uservoice.com
My Personal Lib : lfspm.lua
I made this because there is some bits of code in my warm-up that could be reused for others projects .
Yes, it’s called lfspm . It stand for LevelFontSoundParticlesMusic . this lib for the love framework permit you to :
- Load a tile based level with a collision system .
- Load a bitmap font and print it.
- Play sounds.
- Have a particle system.
- Play a music.
I basically copy-pasted code from my Warm-up in a single file.
Download : Here
Note that :
- The level format is a bit complex . You have a img/tileset.png, a img/tilesetdata.png who is the size of img/tileset.png divided by tilesize, and define properties for the tiles, and some lvl/number.png which use r and g for x and y of the tileset…
- You need SECS to use this lib.
- You must have defined scale and tilesize .
- You are totally allowed (and encouraged) to modify, improve, and distribute this code .
AS3 Vector Utils
Hey folks,
After the compo I decided to clean up and make available the Vector utility functions I have used in some of my games. I hope you find this repo useful for your future projects. Please let me know if you see anything that is broken/wrong or that you’d like to have added.
Presenting Generic Netplay Implementation, an experimental and possibly buggy C# network library
Monday, April 16th, 2012 2:05 pmI probably won’t use this next weekend, but I’m posting this just in case I do want to use it.
GNI is a library to facilitate some simple, easy to use communication between a server and any number of clients.
Please note that this was coded in a relatively short time span, it was not tested extensively, network code is vulnerable to tons of unpredictable bugs, and my experience with netplay development is limited.
What I want to say is, don’t rely on it unless you’re capable of fixing bugs in it, as it might break at the worst possible moment.
The example chat program I wrote seems to work perfectly, though, so it should work. ‘Should’ being the key word here.
Features
-Simple way to send signals from server to client and vice versa, without bothering with minor technical details
-Automatically calls a function when a signal is received, a player connects, or a player disconnects
Download
Code includes a simple chat server project and chat client project as examples.
DLL download link (5 KB)
Source download link with example (19 KB) (Microsoft Visual Studio 2010 solution)
How it works
Small packages of information called GNIDatas are sent through the library. When received, it’s reconstructed as a GNIData struct.
GNIData consists of a key-value pair, with the keys or values being shorts (16-byte integers), strings, or nothing.
Server
-The server class must inherit from the library’s GNIServer class.
-Call StartServer(…) to start the server. You can have it check for incoming signals automatically, or choose to do so manually by calling Update().
-Override OnDataReceived(GNIData data, uint source) to interpret signals. It’s called from Update when a full GNIData has been received. ‘Source’ is the clientID of the client that sent the signal.
-Override OnClientConnected(GNIClientInformation client) if you want something to happen when a player joins. (The client is automatically added to the client list.)
-Override OnClientDisconnected(GNIClientInformation client) if you want something to happen when a player disconnects. (The client is automatically removed from the client list.)
-Use SendSignal(…) to send a GNIData to a client, or BroadcastSignal(…) to send a GNIData to every client.
-Send empty signals (datatype and valuetype ‘none’) if you want the server to automatically detect if a connection has been lost; otherwise it won’t notice until it fails to send a signal to it.
Client
-The client class must inherit from the library’s GNIClient class.
-Call StartClient(…) to start the client. It WILL NOT check for incoming signals automatically; call AutoPoll() to have it do that. Alternatively, call Update() whenever you want to check for incoming signals.
-Override OnDataReceived(GNIData data, uint source) to interpret signals. It’s called from Update when a full GNIData has been received. ‘Source’ is always 0 and meaningless in the client.
-Use SendSignal(…) to send a GNIData to the server.
-To be honest, I’m not sure what happens when the client unexpectedly loses connection to the server. It’ll probably throw an exception, so just catch that.
Documentation
Does not exist. If you can’t figure out the code, it’s best not to use it as it might still be buggy.
License
This work is licensed under a Creative Commons Attribution 3.0 Unported License.
You are free:
* to Share — to copy, distribute and transmit the work
* to Remix — to adapt the work
* to make commercial use of the work
Under the following conditions:
* Attribution — You must attribute the work in the manner specified by the author or licensor (but not in any way that suggests that they endorse you or your use of the work).
Have fun, and good luck with your games.
Presenting VDZ’s Basic XNA Sprite Engine
Sunday, April 15th, 2012 3:06 pmSince I didn’t want to rewrite a whole bunch of code next weekend, I decided to tidy up and release this bunch of code.
It’s some helpful code that allows for easy sprite handling in XNA 4.0.
Features
-Easy sprite creation (just CreateSprite(name, position) and it’ll automatically render it from that point on)
-Changing position, scaling, rotation is also easy
-Depth system where deeper sprites are always rendered behind less deep sprites
-Automatically loads the Content/Graphics folder for you so you can just refer to the images by name
-Basic layered sprite support (multiple sprites combining to make one sprite, for example a base body with armor and a weapon overlaid on it)
-Basic animation support
-Licensed under Creative Commons Attribution 3.0 Unported, so you’re free to modify it or use it commercially
Code includes a simple example project.
DLL download link (MediaFire, 7.43 KB)
Source download link with example (MediaFire, 92.74 KB) (Microsoft Visual Studio 2010 solution)
Basic documentation
How it works
-Create a folder ‘Graphics’ with at least 1 image in it in your Content folder. The folder or any of its subfolders must not contain any non-graphic files.
-Put a SpriteFont in your Content folder with the name ‘Default’. It will be used as font for GTexts and the log.
-Call SpriteEngine.Initialize in the constructor of your XNA game class (note that it MUST be in the constructor, NOT in Game.Initialize()), after setting Content.RootDirectory.
-Call SpriteEngine.LoadContent in the LoadContent method of your XNA game class.
-That’s all the initialization it needs. Call SpriteEngine.Draw in your Draw method to actually have it do something. Note that it does not clear the screen for you; keep GraphicsDevice.Clear in there.
-If you want to use animations or ‘camera scrolling’, call SpriteEngine.Update in your Update method.
-From now on you can use SpriteEngine.CreateSprite to create sprites in your game. It returns a sprite object, which you can use to change its position, rotation, image, etc. Use SpriteEngine.EraseGObject to erase a sprite, or SpriteEngine.Nuke to erase everything.
Classes
SpriteEngine – Main class. Most of the functions you need will be in here.
GObject – Base class for displayable objects (Sprites and GTexts). Contains basic information like position, scale and depth.
GText – A displayed string that can be moved around and has a depth, much like a sprite.
Sprite – Class representing a sprite, containing basic information such as its position, images, rotation, scale, etc.
LayeredSprite – A sprite composed of multiple sprites. Uses a simple layer system where when the sprite is drawn, all of its sub-sprites are drawn at its location instead.
Details on what each property and method does can be found in comments in the code, I’m too lazy to type them all out.
License
This work is licensed under a Creative Commons Attribution 3.0 Unported License.
You are free:
* to Share — to copy, distribute and transmit the work
* to Remix — to adapt the work
* to make commercial use of the work
Under the following conditions:
* Attribution — You must attribute the work in the manner specified by the author or licensor (but not in any way that suggests that they endorse you or your use of the work).
Have fun, and good luck with your games.
Java Pathfinding Library
Just releasing a quick library I plan to use in Ludum Dare, consisting of a maze generator and an implementation of A* in java.
https://github.com/xSmallDeadGuyx/SimpleAStar
jsGameSoup cross browser Javascript game engine
Hey LD48ers,
Just wanted to post a quick heads-up about my cross-browser Javascript game dev library, jsGameSoup.
I think you will find it a very quick way to make a game and get it in front of players! For example, I made this demo in a few hours.
Have fun!
SFML and AntTweakBar
I couldn’t find any ready-made function for connecting sfml and AntTweakBar so I made one. Somewhat ported from the sdl source, and I figured I’d post it here since someone might want to use it.
SfmlHandle(), line 40(currently) in this file. It is currently kinda hacked together so it doesn’t support scrolling or text-input (yet), but it’s better than nothing
C library functions for LD13
I’m thinking about entering LD13 depending on what the theme turns out to be. I haven’t done a full LD yet, just 2 mini-LD’s. I wanted to use my standard C library functions for OpenGL, Portaudio, Ogg/Vorbis/Vorbisfile, and my GUI. There isn’t any game logic routines or structures as per the rules. It’s a collection of sound, text file, opengl drawing, and string tools for C.
I wasn’t sure what I have to do or if there is some type of time limit, but anyway here is a link to the library code. It’s mostly a conversion of some old SDL stuff I liked to use. I moved away from SDL lately though and have been using GLFW.
I hope you guys are prepared…
I just made my first giant clock! I am so ready for Ludum Dare now that I have this incredible custom library at my fingertips:
import os, pygame, random, math, pgu
from pygame.locals import *
clock = pygame.time.Clock()
pygame.init()
screen = pygame.display.set_mode((800,480))
timer = 0
seconds = 0
minutes = 0
timertext = str(minutes) + “:” + str(seconds)
background = pygame.Surface(screen.get_size())
background = background.convert()
background.fill((250, 250, 250))
font = pygame.font.Font(None, 500)
text = font.render(timertext, 1, (10, 10, 10))
background.blit(text,(0,0))
screen.blit(background, (0,0))
quit = 0
while not quit:
for e in pygame.event.get():
if e.type is QUIT: quit = 1
if e.type is KEYDOWN and e.key == K_ESCAPE: quit = 1
background.fill((250, 250, 250))
text = font.render(timertext, 1, (10, 10, 10))
background.blit(text,(0,0))
screen.blit(background, (0, 0))
pygame.display.flip()
clock.tick(60)
timer = timer + 1
if timer == 60:
seconds = seconds + 1
timer = 0
if seconds == 60:
minutes = minutes + 1
seconds = 0
if seconds <= 9:
timertext = str(minutes) + “:” + “0″ + str(seconds)
else:
timertext = str(minutes) + “:” + str(seconds)
Matt’s Custom Library
CEngine is a Python library I started writing mid-2007 for doing a remake of Chaos: Battle of Wizards by Julian Gollop. The library uses PyGame and OpenGL and is still far from complete – I haven’t even started on the remake yet, but there is some functionality in the library that may be useful for this competition.
Another library suitable for timed competitions: Ruby/Gosu
With all the C/Python/SDL-based libraries mentioned here, I’d like to advertise my/our gamedev library, Gosu. It has originally been my private library, spread only via ICQ/IRC to interested people, until I made it public to use it for my LD3. That is a while ago, and in the meantime, it has been used for some LD entries by me and other people, also for more serious projects, and is actually documented.
Long story short, Gosu is a 2D game development library for Ruby and C++. I guess the C++ version is a bit too heavy to learn until Friday *and* actually use, though. The Ruby version gets you up and running quickly.
Pro (compared to your generic SDL wrapper): *Very* fast graphics with rotations and all that, because the library was designed to use OpenGL; an API which tries not to get in your creativity’s way; examples on how to integrate it with ImageMagick and the Chipmunk physics library; serious OS X support.
Contra: Linux port misses gamepad support; can’t handle too complex text input well.
If you would like to give it a try, the library can be found at http://code.google.com/p/gosu.
Phil’s LD10 Custom Library
The library I have is a in-progress re-write of my pgu library .. sort of a “the best bits” version. Anyway, here it is:
svn://www.imitationpickles.org/pug/trunk
The gui API is about the same as pgu, so if you wanted to use it, you probably could. It’s lots better
Other than that, I’ll be using pygame and python as per usual. I’ll also be using pyplus + swig in the event that I need to write any C extensions.
Update: check out demo2.py – for low-CPU updates and Joystick support!
PoV’s LD10 Custom Library
Assuming I get around to entering, there’s a good chance I’ll be using this as my foundation, with Allegro.
It’s a collection of header files and code, commonly found in my more recent prototypes. C++.
- A vector math/matrix library, plus some other math tools. Partially documented!
- A set of functions for drawing circles, lines, and rectangles with Allegro, transformed by a matrix.
- A collection of string functions to compliment STL String. Mostly for filename manipulations (get the base name, directory only, etc).
- Class building tools (including the “useful” part of Boost)
- FileIO with Compression (LZMA, BZIP, ZLIB)
And that’s that.





