Home
JAQForum Ver 24.01
Log In or Join  
Active Topics
Local Time 06:17 20 Apr 2026 Privacy Policy
Jump to

Notice. New forum software under development. It's going to miss a few functions and look a bit ugly for a while, but I'm working on it full time now as the old forum was too unstable. Couple days, all good. If you notice any issues, please contact me.

Forum Index : Microcontroller and PC projects : animation demo's

Author Message
Peter63
Senior Member

Joined: 28/07/2017
Location: Sweden
Posts: 153
Posted: 01:30am 19 Apr 2026
Copy link to clipboard 
Print this post

I made a simple animation that I did in Paint.NET.  
Try it out and give comments on how it can be improved.  
I might be programming completely wrongly or unnecessarily.  
Change the program and give suggestions on how it can be written instead.





jump-v3.zip
(using PicoMite MMBasic)

/Peter63
Edited 2026-04-19 12:45 by Peter63
 
Peter63
Senior Member

Joined: 28/07/2017
Location: Sweden
Posts: 153
Posted: 05:33am 19 Apr 2026
Copy link to clipboard 
Print this post

I have increased from 6 sprites to 24 sprites. Front, Right, Left, Back - sprite.
To get a bit more realistic movement.



new version program  
jump-v5.zip

/Peter63
 
Martin H.

Guru

Joined: 04/06/2022
Location: Germany
Posts: 1447
Posted: 11:54am 19 Apr 2026
Copy link to clipboard 
Print this post

Of course, there’s still plenty of room for improvement,
but it’s a rather sweet idea
'no comment
 
Peter63
Senior Member

Joined: 28/07/2017
Location: Sweden
Posts: 153
Posted: 12:32pm 19 Apr 2026
Copy link to clipboard 
Print this post

a little hair and a little hat, version 9




jump-v9.zip

/Peter63
 
Martin H.

Guru

Joined: 04/06/2022
Location: Germany
Posts: 1447
Posted: 02:33pm 19 Apr 2026
Copy link to clipboard 
Print this post

Just a quick tip for optimisation
A large proportion of your sprites are identical, so if you split your sprites into two elements, you can save quite a lot of memory.


Horizontally, the face remains the same; vertically, the spring.
That way, 10 sprites would be enough for everything; if you mirror the left/right face, you’d only need 9
Edited 2026-04-20 00:34 by Martin H.
'no comment
 
Peter63
Senior Member

Joined: 28/07/2017
Location: Sweden
Posts: 153
Posted: 04:56pm 19 Apr 2026
Copy link to clipboard 
Print this post

Hello, Martin
  Quote  A large proportion of your sprites are identical, so if you split your sprites into two elements, you can save quite a lot of memory.


Yep, you're right, optimization is needed to minimize memory usage.

Thank you for your feedback, I appreciate that.

Then I don't really know how to optimize the program code, someone who is good at it is welcome to give suggestions.

/Peter63
 
Martin H.

Guru

Joined: 04/06/2022
Location: Germany
Posts: 1447
Posted: 06:43pm 19 Apr 2026
Copy link to clipboard 
Print this post

Peter,
Functionality comes before optimisation
  Quote  Then I don't really know how to optimize the program code, someone who is good at it is welcome to give suggestions.

First of all, it’s important that you manage to turn your thoughts into a programme that actually does what you want it to do.
' --- main loop ---
Do

k=Asc(Inkey$)

If k=27 Then Exit Do

If k=32 Then ' space = compress jump
 compress_jump x,y,30
End If

If k=128 And y>50 Then ' up arrow
 y=y-8
 compress_jump x,y,30
End If

If k=129 And y<200 Then ' down arrow
 y=y+8
 compress_jump x,y,30
End If

If k=130 And x>8 Then ' left arrow
 x=x-8
 compress_jump x,y,30
End If

If k=131 And x<300 Then ' right arrow
 x=x+8
 compress_jump x,y,30
End If
Loop

You could certainly do it that way;
I’d actually prefer to replace it like that (untested).


do
 nope=0
 k=Asc(Inkey$)
 Select case k
   Case 27
     Exit do
   Case 32
   ' space = just compress jump
   case 128 ' up arrow
     Inc y,-8*(y>50)
   Case 129' down arrow
     inc y,8*(y<200)
   Case 130 ' left arrow
     inc x,-8*(x>8)
   Case 131' right arrow
     inc x,8*(x<300)
   case else
     nope=1
 end select
 if not nope then compress_jump x,y,30
Loop

and even that can be optimised further
Its all related to your Version V3
But it’s a learning process, so give it a go your own way. That way, the sense of achievement will feel more genuine.
Cheers
Martin
Edited 2026-04-20 05:04 by Martin H.
'no comment
 
Print this page


To reply to this topic, you need to log in.

The Back Shed's forum code is written, and hosted, in Australia.
© JAQ Software 2026