It is currently Wed Oct 23, 2019 6:59 pm

All times are UTC + 1 hour




Post new topic Reply to topic  [ 2 posts ] 
Author Message
 Post subject: What if pb's sprites were objects ?
PostPosted: Wed Feb 27, 2019 8:54 pm 
Offline
Enthusiast
Enthusiast
User avatar

Joined: Thu Apr 30, 2009 5:23 pm
Posts: 306
Location: Côtes d'Azur, France
A small test, turning pb sprites into objects ...
Simplified reading of a sprite sheet (we just give the name of the sprite sheet, the line number we want to add with the name of its sub-animation ...)

Simple addressing of an animation and sub-animation by a string (for example the animation "Hero" and the sub-animation "Kick" ...)
Play / pause of an animation, modification of speed's display, display by depth's order, progressive transparency until invisibility and vice versa etc ...

Lots of things to add and debug : collision with quadtree returning a list of the objects concerned, Gui in sprites, pathfinding, gravity and objects on which we can stand...
http://dl.free.fr/cOBhXufjw
Compile the Example.pb file of the archive.
Direction arrows and space to interact. (left Ctrl key for a transformation)

The blue and red character just illustrates the replacement of a color in an animation and the duplication of an "object" of type animation.
Backgrounds illustrate the scrolling mode. (and my lazyness to use photoshop ... ^^)
I used some of the animations of this Megaman spritesheet, taken on this site http://www.sprites-inc.co.uk/, for the example.

I made a deposit on GitHub, if you want to participate in the improvement of the program ...
https://github.com/FoxFig/2DSpriteObject

Image

_________________
There are 2 methods to program bugless.
But only the third works fine.

Win10, Pb x64 5.70 LTS


Top
 Profile  
Reply with quote  
 Post subject: Re: What if pb's sprites were objects ?
PostPosted: Wed Feb 27, 2019 10:39 pm 
Offline
Enthusiast
Enthusiast
User avatar

Joined: Sun Sep 11, 2016 2:17 pm
Posts: 544
Definetely a good idea i went a similar route when i wrote the gfx part of my 2D engine.
Its way more straight forward and pleasant to work with.


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 posts ] 

All times are UTC + 1 hour


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  

 


Powered by phpBB © 2008 phpBB Group
subSilver+ theme by Canver Software, sponsor Sanal Modifiye