Jump to content

Recommended Posts

I've brought upon not one, but two gifts for the loving 7800 community.

 

Gift Number 1: A playable demo of my Lyra game ported to the 7800 in both rom formats that tickle your fancy.rumchurjump_take4.bas.a78rumchurjump_take4.bas.bin

 

My second gift is something special, for those that want to make a smooth platformer using 7800basic, I'm providing the source as a template for anyone to use.

I'm hoping @RevEng would put the sample code in the next 7800Basic update.

 

Source Code: rumchurjump_take4.bassmoothplatformer.bas

 

HAPPY HOLIDAYS, ATARIAGE! AND HAVE A MERRY CHRISTMAS! :)

Edited by ZippyRedPlumber
  • Like 18
  • Thanks 2
On 12/22/2022 at 3:01 PM, ZippyRedPlumber said:

I've brought upon not one, but two gifts for the loving 7800 community.

 

Gift Number 1: A playable demo of my Lyra game ported to the 7800 in both rom formats that tickle your fancy.rumchurjump_take4.bas.a78rumchurjump_take4.bas.bin

 

My second gift is something special, for those that want to make a smooth platformer using 7800basic, I'm providing the source as a template for anyone to use.

I'm hoping @RevEng would put the sample code in the next 7800Basic update.

 

Source Code: rumchurjump_take4.bassmoothplatformer.bas

 

HAPPY HOLIDAYS, ATARIAGE! AND HAVE A MERRY CHRISTMAS! :)

Merry christmas @ZippyRedPlumber! ;) 

I'd post my 2600 christmas and snow demos, but due to the fact that I've moved to a new compy, I've lost them. =(

Edited by Ecernosoft
  • 5 weeks later...

Managed to make lyra walk left, but when she walks right the animation glitches out. Can anyone help me with this?

 

Rom lyra_7800_2023y_01m_24d_0335t.78b.binlyra_7800_2023y_01m_24d_0335t.78b.a78

 

Source: lyra_7800_2023y_01m_24d_0335t.78b

 

Graphics: gfx.zip

 

 

  • Like 1
1 hour ago, ZippyRedPlumber said:

Managed to make lyra walk left, but when she walks right the animation glitches out. Can anyone help me with this?

 

 

In the two lines of code below, I changed herodir=1 to herodir=2 and the glitching disappeared. 

 

  if joy0right then herodir=1:herox=herox+1:goto joydone

  if joy0right && gravity=0 then herodir=1:herox=herox+1:goto joydone 

 

On 1/26/2023 at 2:54 PM, Mord said:

 

In the two lines of code below, I changed herodir=1 to herodir=2 and the glitching disappeared. 

 

  if joy0right then herodir=1:herox=herox+1:goto joydone

  if joy0right && gravity=0 then herodir=1:herox=herox+1:goto joydone 

 

Thanks @Mord that worked like a charm :)

Now I need to know how I can change sprite frames as she's jumping & or when down is held on the joystick. Is this correct?

 

Quote

  ;used when player moves left/right while jumping or falling.
  if !_FireB_Restrainer then plotsprite fire_jump 1 herox heroy
  if !joy0left && !joy0right && !_FireB_Restrainer then plotsprite fire_jump 1 herox heroy
  ;used when player moves left/right while jumping or falling.
  plotsprite fire_jump 1 herox heroy
  if !joy0left && !joy0right && then plotsprite fire_jump 1 herox heroy

 

gfx.zip

Not entirely sure although the last two lines of code you have won't work well - they appear to be missing variables.  the last one in particular will case a panic since there's nothing after the && to compare/test, so it'll try to test the 'then' keyword I think.

 

You'll probably want to make sure you're only going to hit one plot statement for plotting the player during the subroutine though. So after you plot, you'll want a return statement. Otherwise you'll potentially have more than one plotted character overlapping each other. 

 

If what you want is to display the fireball sprite while the player is in a jump or falling, you'll want something like this for your drawhero routine.

 

  if _Fall_in_Progress || _FireB_Restrainer then plotsprite fire_jump 1 herox heroy : return

  mytemp1=herodir+walkframe 
  plotsprite walk_left_1 1 herox heroy mytemp1 

 

If you only want it when going up, you can probably remove the _Fall_in_Progress portion of the if and test just on _FireB_Restrainer. 

 

If you want the fireball sprite during a full active jump, but not during a passive fall (walking off a ledge) you could make a variable that gets set to 1 when you press the jump button, and gets reset to 0 when the player lands/touches a solid tile.  That way if they walk off a ledge the fire sprite won't be displayed.  If you do use a variable like that, you can test that variable when plotting the fire_jump instead of _Fall_in_Progress and _FireB_Restrainer.

 

Could be wrong, but feels like it would work.

 

  • Like 1

So, I decided to make Lyra a 16x32 character by stitching 2 8x16 sprites & it's back to graphical glitches to the top sprite. Any idea on how to fix this?

 

Rom:lyra_7800_2023y_02m_03d_0706t.78b.a78

 

Bas:lyra_7800_2023y_02m_03d_0706t.78b

 

Graphics:graphix.zip

  • Like 1

I don't think you need to stitch two sprites together (unless you have a specific reason for doing so) as the 7800 will happily take a 16x32 sprite.

 

In fact, the 7800 is happy with sprites in any multiple of 4 for the width so 8, 12, 16 would all be fine.

 

 

1 hour ago, Muddyfunster said:

I don't think you need to stitch two sprites together (unless you have a specific reason for doing so) as the 7800 will happily take a 16x32 sprite.

 

In fact, the 7800 is happy with sprites in any multiple of 4 for the width so 8, 12, 16 would all be fine.

 

 

There is a specific reason, so that the sprites display properly. I just did it the way you suggested by making some tall frames, but now it only displays the characters head.

6 minutes ago, ZippyRedPlumber said:

There is a specific reason, so that the sprites display properly. I just did it the way you suggested by making some tall frames, but now it only displays the characters head.

Could you zip up your modified source and graphics so one of us can see what's going on? I guarantee that @Muddyfunster is correct in saying that you shouldn't have to stitch together two sprites to do what you are trying to do here.

19 minutes ago, Karl G said:

Could you zip up your modified source and graphics so one of us can see what's going on? I guarantee that @Muddyfunster is correct in saying that you shouldn't have to stitch together two sprites to do what you are trying to do here.

Sure thing @Muddyfunster @Karl G

 

Here you go. 

lyra7800.zip

1 hour ago, ZippyRedPlumber said:

You had "set tallsprite off", which would explain why it got cut off. I commented that out, and I also had to rename graphix to gfx to get it to compile. After that, it seems to display correctly. There are still some issues with frame progression with your animation that you will need to address, though.

 

200694669_Screenshotfrom2023-02-0411-14-07.thumb.png.73dc33103bae3cfcb0e10f2a9341410f.png

  • Like 1

Looking at the graphics, they are still 8x16 images, not the combined 16x32 images like was discussed. Looking at the code, you are also plotting the sprite in sections, too. If you combine your images and let 7800basic handle the bigger images, you will save CPU time as well as making debugging of the animation frames much simpler.

 

Your drawing routine:

drawhero
  if _Fall_in_Progress || _FireB_Restrainer then plotsprite fire_jump 1 herox heroy:return
  if _Duck_in_Progress then plotsprite fire_jump 1 herox heroy:return
  mytemp1=herodir+walkframe
  plotsprite walk_left_bottom 1 herox heroy mytemp1
  mytemp2=heroy-16
  plotsprite walk_left_top 1 herox mytemp2 mytemp1
  return

 

Went back to the stitch method, managed to fix some frames but still ran into a problem. Can anyone care to show me what I did wrong & what I can do to fix it.

 

Here's a diagram of my issue. The green checks mean that frames are correct,

red Xs mean these frames need fixed;image.thumb.png.97777bb7e5a62409c0c050e2f0b7e726.png

Folder: 

lyra7800.zip

Edited by ZippyRedPlumber
On 12/22/2022 at 3:01 PM, ZippyRedPlumber said:

I've brought upon not one, but two gifts for the loving 7800 community.

 

Gift Number 1: A playable demo of my Lyra game ported to the 7800 in both rom formats that tickle your fancy.rumchurjump_take4.bas.a78rumchurjump_take4.bas.bin

 

My second gift is something special, for those that want to make a smooth platformer using 7800basic, I'm providing the source as a template for anyone to use.

I'm hoping @RevEng would put the sample code in the next 7800Basic update.

 

Source Code: rumchurjump_take4.bassmoothplatformer.bas

 

HAPPY HOLIDAYS, ATARIAGE! AND HAVE A MERRY CHRISTMAS! :)

Merry late christmas @ZippyRedPlumber!!

I know it's almost Valentines but still. I'm coming back breifly...... for some reason. 

 

Keep up the good work! Hopefully, one day, Lua will become a reality....... :) 

  • Haha 1

When you declare your frame by frame animations for a sprite you need to keep them in the correct order for the keyframe counter to work correctly.

 

This code:

incgraphic gfx/walk_left_bottom.png 160A 0 1 2 3 1
incgraphic gfx/walk_left_bottom2.png 160A 0 1 2 3 1
incgraphic gfx/walk_right_bottom.png 160A 0 1 2 3 1
incgraphic gfx/walk_right_bottom2.png 160A 0 1 2 3 1
incgraphic gfx/walk_left_top.png 160A 0 1 2 3 1
incgraphic gfx/fire_jump.png 160A 0 1 2 3 1
incgraphic gfx/walk_right_top.png 160A 0 1 2 3 1

 

To keep it clear I would change it to this:

incgraphic gfx/walk_left_bottom.png     160A 0 1 2 3
incgraphic gfx/walk_left_bottom2.png   160A 0 1 2 3
incgraphic gfx/walk_right_bottom.png   160A 0 1 2 3
incgraphic gfx/walk_right_bottom2.png 160A 0 1 2 3
incgraphic gfx/walk_left_top.png           160A 0 1 2 3
incgraphic gfx/walk_right_top.png         160A 0 1 2 3
incgraphic gfx/fire_jump.png                 160A 0 1 2 3

 

This not only reorders the graphics in an easier to read format, it also keeps like things together.

Notice that I also removed the additional "1" at the end of the color declarations on the images. 160A can only have 4 colors (0-3) so the additional color might cause issues. That additional "1" is used for the plotsprite command and defines the keyframe.

 

The main issue is with your "keyframe" code that defines the animation image to show.

 

I know that you are planning on replacing the two separate sprites and stitching them together. That would fix the animation issue, but you have walk_left_bottom.png and walk_left_bottom2.png in order. So your two keyframes are 0 and 1. If you go over that number then you get the next image, which would be walk_right_bottom.png instead of flipping back and forth between the two images.

 

 The following code is in your "main":

frame=frame+1
if (frame&7)=0 then walkframe=(walkframe+1)&1

 

By adding "1" to the frame immediately you are jumping to another frame of animation. It does seem to work overall, though.

 

Also, here you are setting the animations for the bottom and the top. I only see one top image, yet you are adding keyframes for 2 images. Remove the "mytemp1" from the walk_left_top OR add images for the second frame of animation.

mytemp1=herodir+walkframe
plotsprite walk_left_bottom 1 herox heroy mytemp1
mytemp2=heroy-16
plotsprite walk_left_top 1 herox mytemp2 mytemp1

I see that changing that also does not change the direction of the character's head. So additional variables for the direction could be added here instead. 0 would be left and 1 would be right. You might be able to use "herodir" but it currently is set for 0 is left and 2 is right. And the herodir+walkframe equation doesn't work correctly that way. So it would need to be adjusted.

 

I replaced that last line with the following and it seems to work properly (for the case that your character only looks left or right):

if herodir=0 then plotsprite walk_left_top 1 herox mytemp2 0 else plotsprite walk_left_top 1 herox mytemp2 1

 

Also, herox should have a limit to stop it from going outside the boundaries (unless you are attempting to wrap around). Any value greater than the width of the screen and less then 256 will be plotted outside of the visible screen. Once a character gets past the screen width it should jump to 0 (or somewhere close, unless you want to write a routine that plots your character twice across the sides of the screens to make it look like it is wrapping around.

 

This looks great! Your jump code is very nice as well. I like the concept of the game. Let me know if I can help out any further.

 

Below is the 7800BASIC code changes attached as well as an .a78 file of the working animation.

 

JS7800: https://raz0red.github.io/js7800/?cart=https://forums.atariage.com/applications/core/interface/file/attachment.php?id=1004457&key=21a95a817ed04d36452b42c81d94323b

lyra_7800_2023y_02m_14d_0312t.saxmeister.78b lyra_7800_2023y_02m_05d_0536t.78b.a78

Edited by saxmeister
  • Like 4

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