Home
JAQForum Ver 24.01
Log In or Join  
Active Topics
Local Time 12:29 21 Jul 2025 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 : PicoMiteVGA: "Brownian motion" sprite example

Author Message
thwill

Guru

Joined: 16/09/2019
Location: United Kingdom
Posts: 4308
Posted: 11:56am 09 Jun 2024
Copy link to clipboard 
Print this post

Hi folks (which probably means Peter),

Just working on sprite support in MMB4L using the "Brownian motion" example: https://www.thebackshed.com/forum/ViewTopic.php?TID=14884#187117

However at the end of the main loop we have:
For i=1 To 64
 vector i, direction(i), 1, x(i), y(i)
 Sprite show i,x(i),y(i),1
  If sprite(S,i)<>-1 Then
    break_collision i
  EndIf
Next i


Except the SPRITE(S) sub-function isn't documented or implemented to take any additional arguments on either the PicoMiteVGA or CMM2.

What gives - other than MMBasic's "loose" error handling ?

Best wishes,

Tom
MMBasic for Linux, Game*Mite, CMM2 Welcome Tape, Creaky old text adventures
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 10277
Posted: 01:22pm 09 Jun 2024
Copy link to clipboard 
Print this post

Looks like a bug in the Basic program - should be

If sprite(C,S,i)<>-1 Then


and as you say additional parameters are not error-ed unless specifically coded for
 
thwill

Guru

Joined: 16/09/2019
Location: United Kingdom
Posts: 4308
Posted: 02:44pm 09 Jun 2024
Copy link to clipboard 
Print this post

Thanks Peter,

I'm going to go out on a limb and suggest you confused yourself and meant:

' If sprite i has any active collisions then ...
If Sprite(C, i) > 0 Then ...


Best wishes,

Tom
Edited 2024-06-10 00:54 by thwill
MMBasic for Linux, Game*Mite, CMM2 Welcome Tape, Creaky old text adventures
 
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 2025