LD23 April 20–23, 2012

Presenting VDZ’s Basic XNA Sprite Engine

Since 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.

Tags: 2D, C# XNA, library, sprite, sprites, xna, xna 4, XNA Game Studio

Participation [Approved]

I’m good to go for LD23.  Below are the tools I plan on using:

My framework is here

 

 

I’m in!!!!!!!

Ludum Dare is awesome. I look forward to it possibly more than anything else. You guys are all awesome, and you make awesome games. Keep it up.

So. This LD is right in the middle of college. But that’s not going to stop me. I’ll just fail all my classes if it comes to that! 😀

Choice utilities:

  • Scala! I traditionally favor Python, but I think I’ll switch it up this time. I recently developed a game in Scala and it was surprisingly fun. It felt like Python with type checking. Plus, Java is cross platform so I won’t have any more porting headaches. That was always one of the worst parts about Python (and having to do it after the game was done, when I just wanted to sleep – ugh!) update: I didn’t actually use scala. Probably a huge mistake :-)
  • Graphics Gale – for busting out ze pixels in record time.
  • FL Studio or Garage Band – I’ve been working on music recently, and it’s one of my goals to score well in the audio category.
  • sfxr – This thing is invaluable.
  • Coffee – sooo much coffee.
  • Sleep – hah, who needs it in LD?

My goal continues to be humble: BEAT NOTCH. 😀 I also want to aim a little higher in the audio and graphics categories than before. I tend to be pretty lazy about graphics – aiming to change this :)

First Timer

So this will be my first year participating in the Ludum Dare challenge. And it’s exciting and scary to think about. I have an idea of what type of game I will be trying to make. I’m gonna have some trouble with the music and sound affects and a lot of trouble with debugging. I made a game in about 36 hours or so.  That wasn’t to bad, but I’m looking to step it up.  If you have any words of encouragement or tips they are much apperciated.

 

Comments

15. Apr 2012 · 23:21 UTC
Good luck! What is your problem with sounds? Have you tried using SFXR to generate sound effects?
16. Apr 2012 · 00:37 UTC
I will say good luck also! SFXR / BFXR is amazing, I could hit the random button all day. Not sure what to do about music, I have GarageBand but never used it and I’m also not a music person :/

I’m in………ish.

I have exams on the 26th, 27th and the 28th so I really shouldn’t dedicate the whole weekend to something proper :(.

I might make something retro ASCII-style in Python using the curses library though…

I really wanted to take part in this one fully as well, dangit.

I’m in!

First time ludum dare and I’m pretty excited! Been lurking for a while but couldn’t make anything due to important life stuff.

A Little About Me: I generally gravitate towards 2D platformers when making games. I usually make games that are pretty difficult and people tend to rage quit a lot I do this because I am amused by others misfortunes. But I think I’ll mix it up a bit and make something not so frustrating. I tend to focus mainly on gameplay rather than graphics and sound. My game’s usually lack polish and that’ll probably be my downfall, but I hope to correct some of my faults with this competition!

Well that’s enough about me!

>I’ll be using Game Maker 8.0 and/or 8.1 because it’s easy to code.

>Gliffy,  pen + paper,  and notepad for design.

>Sfxr for sound.

>I guess I’ll use Notessimo , Wolfram and/or Aviary for music depending on what type of style I’m going for.

>Graphic’s Gale,  GIMP, Adobe Fireworks, and/or Paint for graphics depending on what type of style I’m going for.

I’m quite new so I don’t know the rules quite well but is stuff like time lapses required?

Anyways, good luck to everyone!

Comments

15. Apr 2012 · 22:47 UTC
Hi, I’m a first timer also but from what I’ve read time lapses aren’t required but there is a section in the voting called Community I think that would be how much you shared during the dare. It seems the people that do time lapses get good community scores but I plan on making up for it with lots of blog posts, maybe that works too…
15. Apr 2012 · 23:20 UTC
you shouldn’t use Wolfram tunes. I know the site is really cool, but all content generated there belongs to (is copyrighted to) Wolfram tunes, and cannot be legally distributed by you without their authorization. :-(

almost ludum dare

i’m going to practice on a project then do ludum dare because i’m so excited. i wonder who is the youngest participant

obligatory desk picture.

this is my desk. it is ready.

desk says “hi”.

blog viewer says “go away”.

“but i can’t go away,” says the desk.

I’m in for LD23

Unlike the last compo, I’ve got the time off work this time! I am ready to rock.

  • Language: Actionscript 3 — FlashDevelop IDE
  • Engine: FlashPunk
  • Level Editor: ogmo
  • Audio: bfxr and sfxr
  • Music: musagi and possibly Audiotracker-c
  • Art: Paint.Net

I will be bringing in a library of my own, somewhat functional, somewhat optimized code pulled from previous compos. 😉 Among other things, it includes an A* implementation.

I also plan on doing a time lapse, but I make no promises.

Pre-In Post

Wow! Already another LD48 on the door step! I almost forgot.

Excited and sad because my commitment levels are maxxed out at the moment. I think i’ll miss the first 5-10 hours of the comp! noooooo!

I may also be slightly hung-over with my little brother having his 21st bday party the night before the comp starts.

Either way it’s time to prep the tools and find my game face. More to come

You Around San Francisco, CA?

I live in Vacaville, CA which is kinda between SF and Sac, so I won’t be able to make it out to the gathering that’s being planned but I am interested in maybe knowing who here is geographically nearby so I can follow you. So let me know if you live near either San Francisco or Sacramento. Who knows could be useful info down the road.

 

Warmup Not Quite Done, But Progressing

Alright, so, I had expected to have enough time to finish my warmup over the weekend, but I hadn’t realized that others would be on my laptop as much as they were this weekend. (Don’t worry, I’ve got next one reserved!) Basically, it’s not done, but I think I can justify a few extra hours tomorrow.

The idea is that you’re an anti-virus program combating viruses in a way sort of like Brawl, protecting the CPU in the arena’s center. You have to punch them off the ring to kill them. The objective is to beat all the viruses, which generate randomly through a period of 15 minutes.

All this work is making me realize I should probably write a personal library for the competition. I spent way to much time on programming basic entity systems yesterday.

You’ll see my warmup entry tomorrow, hopefully!

Participating

Guess I’ll try to make something for this for once… I’ve read about this before, but never really looked into it. 😛

I’ll pretty much be using C++ and SFML. I’ve actually been using both for a few years, but I usually don’t ever finish anything. 😛 The first thing that actually got finished was Warehouse Panic (and my friend, u9, did most of the work), and I really haven’t finished anything since. I’ve gotten a couple of things close, but most things that I’ve finished are private tools for one of my parents.

This is going to be interesting since I’m going to be out of town for the whole thing (minus a few hours), and the laptop I use (Mac) isn’t exactly my favorite for programming… Oh well. I can still try. 😛

I have some extra code lying around that I’ll probably reuse (like this), but needs to be separated from the actual project first.

Comments

16. Apr 2012 · 00:13 UTC
Haha, that’s awesome. I will be using SFML to, I wish you luck in finishing the ludum dare it will be a challenge for me to finish also.
16. Apr 2012 · 19:35 UTC
Thanks. :) You too.

My Tools

My tools are very simple I don’t use anything fancy. I use eclipse CDT, and notepad to write my code, GIMP  and MS Paint to make my art. As for music I have yet to decide a tool, but as for sound effects I use audacity. The graphics library I use is called SFML http://www.sfml-dev.org/ it’s a light weight graphics library, good for making things quickly. All my other libraries are libraries that I have built off of SFML specifically for GUI’s.

I’m not in…

So I’ve thought long and hard about this month’s Ludum Dare and it looks like I won’t be able to enter this time…

Between travelling and attending a birthday party it just looks like it won’t be happening, sorry to let everyone down…

 

Oh who am I kidding… I’M IN!!!!

Gonna be using c++ and the Psybrus engine (hopefully) and my shiny new wacom tablet I got for GGJ for graphics and will hopefully pump something out! Realistically speaking I’m probably going to end up in the Jam (wasn’t lying about the birthday and travelling) so I’ll need the extra time!

 

I’m in

I will be using Javascript again and my engine that I am working on. It can be found here: https://github.com/TylerMitchell/H5GE_Overhaul

I will be using Notepad++ as my IDE, Paint.NET for my graphics,  Audacity and maybe Anvil Studio for my sounds and music. My pledge for this LD, unlike my previous attempts is to set my scope small enough to get the game programmed in 24 hours so that I can spend the next 24 tweaking and polishing. I will finish this time (unlike last time)

Warmup Accomplished

http://www.50ply.com/showoff/

Whew. I’m glad I had time this weekend to kick the tires! Again, my stack:

I met a lot of the goals I had set for my tool development this weekend:

  • Reasonable collision physics
  • Controls
  • Sound
  • Map data stored as a color coded png
  • Entity protocol

I missed a few goals too:

  • No text display
  • No interactive objects
  • No menus

I’m really glad I did this warmup. I feel much more prepared for next weekend. See you all then!

Game Jam Time

People,

Figured i’d go ahead and drop the obligatory tools post.  So here goes

  • Impact Javascript: HTML5 Canvas / Javascript game framework
  • Inkscape: Vector art
  • Garageband: Music
  • Komode Edit: IDE
  • Assorted Tools: Spritemonkey, MAMP, dropbox
  • Energy: UKFdubstep, Skrillex, Nero, Porter Robinson, Pantera, Metallica, Feed Me, delicious panini, and hummus

I can’t wait to play all (well, not ALL) of your games!

 

Cheers,

Mark Johnson

Tags: LD #23

Comments

bitbof
22. Apr 2012 · 12:04 UTC
Hey there, I hope you’re making good progress. I’m regularly checking your blog in case you want me to test 😉

Im in

Im joining the LD this time around, language will likley be python