Home
JAQForum Ver 24.01
Log In or Join  
Active Topics
Local Time 06:57 14 Nov 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 : CMM2 code snippets and examples

Author Message
capsikin
Guru

Joined: 30/06/2020
Location: Australia
Posts: 342
Posted: 03:57am 27 Jul 2020
Copy link to clipboard 
Print this post

I've moved the discussion to a new topic as you suggested.

  mkopack73 said  
  jeff510 said  
  thwill said  
What would you suggest about other code that people wish to share but were not publishing from their own git repositories or websites, e.g. implementations of basic datastructures and algorithms, simple games, interfaces to hardware, etc.


I think we should move the discussion to a new topic, but I think as a general outline it should probably include:
-Keyscan (arrows, arrows w/ wasd, all keys)
-Basic Movement (directional, grid, thrust)
-Sprite Groups
-Collisions
-Turtle Graphics Examples
-Some demos of the color system
-Text animation
-Bullets (single and group)
-And some basic games: a 2-player chase game, asteroids, a shmup (simpler than space invaders), tic-tac-toe, snake.


Add to that list:

* Sound and music
* Joystick interfacing (although I have already put together code for that)
* Best practices (coding style, structure, etc)
* Game loop principles
* using data files (sequential files/random access files) for storing/loading game data on the fly
* CSubs (I would love a good tutorial on this!)

A good (and would seem to be very simple to do) game that could use a lot of this is a Frogger clone... - drawing backgrounds, sprites with scrolling, collision detections, background music + sound effects...joystick+keyboard input routines.


Ideally I'd like to see us put together small code snippets for literally EVERY single command/function in the manual and every variation of the them... That way it would be easy for a newbie to look in the manual, see something like "See lines 35-70  of drawingprimitives.bas for demonstration" and they'd know exactly where to go to see that command being called and used.


I'd like to suggest some variations on grid based movements:
1: as in dig dug. You can move smoothly from one grid space to the next. Also stop part way in between. Or turn back towards original grid space. But if you're partway between the locations on your left and right, for example, you can't move up or down immediately - trying will complete your current move first.
2: as in pengo. Always move a whole grid space, but smoothly over several frames, so at some points you're part way between. I think frogger's kind of the same for the frog movements except when you're moving on a log.
3: as in boulderdash. whole grid space movement only.
4: gauntlet I think doesn't really have grid based movement, but it's movement in a grid of tiles, with tile sized objects, so a grid may be a useful model.
 
mkopack73
Senior Member

Joined: 03/07/2020
Location: United States
Posts: 261
Posted: 12:24am 28 Jul 2020
Copy link to clipboard 
Print this post

Ok, I updated my GitHub (https://github.com/mkopack73/cmm2_tests.git

In there is now a "keytest.bas" that shows how to scan the keyboard and read the keys for keyboard based game input.

Nunchucktest.bas and joytest.bas show how to read the gamepad and nunchuk...

SysInfo.bas shows how to poll the various MMinfo settings.

All of my programs use the stdsettings.inc file (which also shows how to use includes)

Hope this stuff helps others who are getting started...
 
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