A Flash Developer Resource Site

Page 1 of 2 12 LastLast
Results 1 to 20 of 30

Thread: [Source] Scroller engine

  1. #1
    Hype over content... Squize's Avatar
    Join Date
    Apr 2001
    Location
    Lost forever in a happy crowd...
    Posts
    5,926

    [Source] Scroller engine

    Was going to post this for 1c1p's first birthday, but was off-line at the time and it kinda slipped me by.

    Anyway it's our scroller engine, which was based on code by Token3 ( Thanks Mike ).
    Basically it's a copy and paste scroller class.
    With that in mind it's not going to run as quickly as a custom written scroller, but it's pretty speedy, and you've just got to pass it some properties and hey presto, instant 8 way scrolling.

    The example is just a simple horizontal scroller ( Based on my old Amiga game "Torque", which was just a copy of the C64 game Uridium ), but it shouldn't be too much effort to alter it to what ever you want.
    The map format for the demo is runlength encoded, but it supports the normal oos / jailbitc'h format.

    The actual class is pretty huge, and I wouldn't even bother looking through it, just accept that it works and it's a nice easy way for you to prototype your game before putting in your own scroller code.

    Have fun.

    Squize.
    Attached Files Attached Files

  2. #2
    Untitled-2.fla
    Join Date
    Jul 2002
    Posts
    391
    Nice one, Squize.

    I’d sing a very belated happy birthday, but I hear the performing rights are quite expensive. But you know where to send the scroller royalties? – right
    The actual class is pretty huge, and I wouldn't even bother looking through it, just accept that it works and it's a nice easy way for you to prototype your game before putting in your own scroller code.
    Reading through the code gave me a headache, but it works like a charm, and it's damn fast for a plug in and play engine

  3. #3
    Hype over content... Squize's Avatar
    Join Date
    Apr 2001
    Location
    Lost forever in a happy crowd...
    Posts
    5,926
    Thanks mate, although you actually wrote the clever bits, I just put this. in front of things

    If I can face it I'll improve the loop unrolling for the vertical stuff, but I very much doubt it.

    Squize.

  4. #4
    Senior Member tonypa's Avatar
    Join Date
    Jul 2001
    Location
    Estonia
    Posts
    8,223
    Why it doesnt work correctly from the fla? I dont see any tiles when tested it, unlike the swf from zip.

  5. #5
    A very senior man mrpauly99's Avatar
    Join Date
    Feb 2002
    Location
    Cool Britania
    Posts
    429
    squize you big show off. throwing tasty morsels to us plebs. youre just trying to keep your guru status ticking over, worship me, worship me...

  6. #6
    Hype over content... Squize's Avatar
    Join Date
    Apr 2001
    Location
    Lost forever in a happy crowd...
    Posts
    5,926
    tonypa:
    Hmmm dunno to be honest. I just found it all today and zipped it up quickly, figured it would work ( Does here ).
    Not finding the map file ?

    Pauly:
    lol, as if.
    I really was going to post it up for the 1c1p first birthday, as a little way of saying thanks to the community for their continued support, but missed it thanks to moving house and being dsl-less.

    I've not used tiles for so long now that it seemed a bit of a waste it just sitting around on my hd.

    Squize.

  7. #7
    Senior Member tonypa's Avatar
    Join Date
    Jul 2001
    Location
    Estonia
    Posts
    8,223
    Strange, it works gine in FMX2004.

    It can be opened in FMX so its MX file and it doesnt give any errors, but no stage is created, when run in MX.

  8. #8
    Hype over content... Squize's Avatar
    Join Date
    Apr 2001
    Location
    Lost forever in a happy crowd...
    Posts
    5,926
    That is v.odd

    It was written in MX ( 2.4k wasn't even out then ) and I just altered a few tiny things today and made a point of re-saving it as a MX file to make it open to more people.

    I'll have a look later see if I can see anything staring me in the face.

    Squize.

  9. #9
    Flash hates me. crashlanding's Avatar
    Join Date
    Nov 2003
    Location
    UK
    Posts
    439
    I have the same problem as tonypa using MX.

    Apart from that, looks pretty cool. Don't have time to go through the code now, but later I'll have a look.

    Nice one Squize!
    "wen i found my gerbil dead my other gerbil was eating it i just cried and screamed"
    http://www.livescripts.net

    --------------------------------------------------------------------------------
    Last edited by some moderator : Today at 9:01 PM.

  10. #10
    Hype over content... Squize's Avatar
    Join Date
    Apr 2001
    Location
    Lost forever in a happy crowd...
    Posts
    5,926
    Thanks mate.

    Haven't got a danny why it messes up in MX. If enough people moan I'll look into sorting it out, otherwise...

    Oh, would my mappy export code be any use to anyone ?

    Squize.

  11. #11
    leight.com.au leight's Avatar
    Join Date
    Sep 2002
    Location
    australia
    Posts
    1,437
    Hey man,

    Pretty nice engine - nice and smooth! One problem: that is my turning trick, I copyright it

    But yeah, nice of you to let it out

  12. #12
    Feeling adventurous? T1ger's Avatar
    Join Date
    Mar 2004
    Posts
    850
    Can you actually copyright code technique? hehe..

  13. #13
    Hype over content... Squize's Avatar
    Join Date
    Apr 2001
    Location
    Lost forever in a happy crowd...
    Posts
    5,926
    Thanks leight ( btw did check your wip site, coming along nicely )

    I think Uridium beat you to the turning trick by a couple of years ( 1986 in fact )

    Squize.

  14. #14
    Senior Member chriserrorplain's Avatar
    Join Date
    Aug 2002
    Location
    london village
    Posts
    623
    hey Squize,

    you just mentioned that your no longer using tiles, what's your favourite way of doing it now? *insert obviously smutty answer from Squize *

    chris

  15. #15
    ditto on the fla problem... the swf plays just fine, but I open the fla and it doesn't work in mx.

    Nugget

  16. #16
    Feeling adventurous? T1ger's Avatar
    Join Date
    Mar 2004
    Posts
    850
    Nice Squize, but I think I'll just continue making my own scroller engines. It's just more fun that way

  17. #17
    ·»¤«· >flashl!ght<'s Avatar
    Join Date
    Jun 2003
    Posts
    746
    (same problem here on MX)

    so is there an advantage to using this sort of method over simply attaching arbitrary objects based on a datastructure divided into screensized tiles...? there must be, because i took one look at the endless sea of lines of code and felt dizzy! ;-)

    but seriously, its a lot more complex, is it alot smoother/more stable or something?

    and that looks like it could be a really fun game, with the switching and such. the style would make a fun WW2 ship sinking(strafing/bombing) game!
    >flashl!ght<
    All the normal names were taken.
    Ron Paul was right.

  18. #18
    Hype over content... Squize's Avatar
    Join Date
    Apr 2001
    Location
    Lost forever in a happy crowd...
    Posts
    5,926
    Bugger

    Looks like I'll have to play around and make it MX compatable, sorry for the wasted d/loads guys.

    Chris, my days of being smutty are long gone
    I still using tile based stuff where I need to, I'm not anti-tb or anything silly like that ( I come from a history of 8/16 bit machines so tb is all I really know ), but I've not had to do anything tiley scrolly for ages.
    It's just a case of using the best approach for what you need. I used tb in a puzzle type game the other month, and yet uxb ( Bomb Jack clone ) is largely art-based.

    T1ger yeah you should mate. This class is just handy for whipping something up nice and quick, so you can spend more time on the gameplay.
    Although it's as fast as most scrollers out there, and pretty flexable, I'd still be kinda disappointed if people just used it for the final game.
    I know kdsh7 had an 8-way scroller up and running using this in about 10mins, and that's what it's there for.
    Cheap and cheerful

    "so is there an advantage to using this sort of method over simply attaching arbitrary objects based on a datastructure divided into screensized tiles...?

    Wow, that's a proper mouthfull
    I don't like the super tile approach, I know it can be quicker ( Much in strille's excellent engine ) but I find it really inflexable.
    To me the main point of tiles is still the original purpose of tiles ( Or "Blocks" if you're as old as me ), and that's to allow a lot of graphical variation taking up as little memory as possible.
    Really well designed tiles don't look like tiles, but I really don't think the same is true about supertiles.
    I know you can use graphics and just lay them down in each spT [supertile] mc, but I imagine setting up the collision detection points is really more trouble than it's worth, having to mess around with each unique spT.
    Sticking with nice little 32x32 tiles gives you a load more possabilities.

    As to the code, there's a load of stuff that isn't really needed, such as the whole hitTest routines ( They're specific to one game ), but I wanted to build it up every time I used it so it could be copy and paste for whatever scrolling project I wanted to do, and also I didn't want to go around deleting code just before zipping it up as it's prone to getting messed up ( Even though it is anyway )

    "and that looks like it could be a really fun game, with the switching and such"

    Uridium is one of my favourite ever shooters, and if you legally own the original for the C64 I'd suggest everyone check it out
    ( Uridium II on the Amiga is still the finest piece of code I've ever seen ).
    Be fantastic if a good clone came about from this code.

    Squize.

  19. #19
    Senior Member St. Nick's Avatar
    Join Date
    Sep 2003
    Location
    Ontario, Canada
    Posts
    312
    Originally posted by Squize

    Oh, would my mappy export code be any use to anyone ?

    I'd like to see it, if it's not too much trouble. I'm looking through the code right now and I appreciate the commented code very much. Props
    - St. Nick

  20. #20
    ********* mentuat's Avatar
    Join Date
    Mar 2002
    Location
    out of office
    Posts
    717
    but..but..but.. how could you mention uridium without mentioning...

    [angel chorus]

    ANDREW BRAYBROOK

    [/angel chorus]

    and his far superior god-like creation...

    [angel chorus]

    PARADROID

    [/angel chorus]

    *sigh* I can sleep easy now

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center