Jump to content
IGNORED

4 Way Scrolling Platform Engine


Gemintronic

Recommended Posts

Didn't want to hijack jbs30000 platform thread so I'll post this example here.

 

This has:

 

4 way scrolling (up, down, left & right)

Workable collision detection. Not perfect but good enough.

Variable jump.

Basic animation for player sprite.

 

This does not show off level loading. The "level" is one screen big. Someday I'd like to figure out how to use pfplayfieldpos to get taller playfields to work but it's beyond me.

 

Hopefully this example will encourage further platforming advances!

pfplatform.bas

pfplatform.bin

  • Like 1
Link to comment
Share on other sites

Didn't want to hijack jbs30000 platform thread so I'll post this example here.

 

This has:

 

4 way scrolling (up, down, left & right)

Workable collision detection. Not perfect but good enough.

Variable jump.

Basic animation for player sprite.

 

This does not show off level loading. The "level" is one screen big. Someday I'd like to figure out how to use pfplayfieldpos to get taller playfields to work but it's beyond me.

 

Hopefully this example will encourage further platforming advances!

 

That runs really smooth. Very nice.

Edited by Cliff Friedel
Link to comment
Share on other sites

Maybe you can add some random terrain to the engine :) Seriously!

 

Some of my code is wacky because of workarounds. Most of it is whacky because I represent all that professional developers hate :) I wouldn't be surprised if the authors of Microsoft Code Complete have a hit on me!

 

The whole collisions get registered only after drawscreen thing sucks. Not bB's fault at all but I don't like it one bit. I literally have to move the sprite into the wall and run drawscreen to detect the collision. It looks bad when I then have to redraw back at the non-contact location. Bouncy bouncy flicker flicker. Thankfully, I only have to call the collision routine once. The rest is pfreads.

 

I still think this topic http://www.atariage.com/forums/topic/148427-vertical-scrolling-through-a-playfield-that-wont-fit-the-screen/page__hl__defaultbasbin has the key to multi-screen platforming goodness. Even if I can't figure out how to pfscroll left or right at least that topics examples can go up and down. See Kung-Fu Master CurtisP's Scroll3A.bas for what I mean.

Edited by theloon
Link to comment
Share on other sites

  • 2 years later...

As far as I know, he's just calling the pfscroll functions that are inherent in all (or at least most) batariBasic kernels. So it's set somewhere deep in the Assembly, though I don't know where.

 

Really, though, it's tough to vary the speeds too much because you can only scroll in a whole pfpixel at a time, so either it's going to snap in every 4 pixels going left/right or every 8 pixels going up/down (not counting for higher pfres settings). Not too smooth in either case.

Link to comment
Share on other sites

I was trying to get boolean logic to be clearer in bB. I figured const/def true = 1 and false = 0 would be more readable. Problem is, I later found out constants don't mix with binary operations. You cannot say "IF mariostats{1} = true THEN GOTO foo"

 

I've since given up on defining true or false. I just use 1 as true and 0 as false from now on.

 

The speed really isn't controlled in this code. It just scrolls at this speed due to the speed of the 2600 running my program. The 2600 cannot scroll the playfield horizontally. All you get is scrolling one chunky playfield pixel column at a time. This makes side scrolling way too fast usually.

 

When I shopped around for feedback in the Homebrew section they were much more unimpressed with the scrolling. I did a better job at side scrolling here:

http://atariage.com/forums/topic/201771-s3-the-sensational-santuci-sisters-wip/

 

I couldn't figure out how to allow moving backwards and forwards when scrolling horizontally. Sprybug even gave me some hints but I couldn't really understand what he meant. All I know is that the screen starts tearing when I try to move left (with the sensational santuci sisters).

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...