Home
JAQForum Ver 24.01
Log In or Join  
Active Topics
Local Time 21:48 25 Nov 2024 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 : (M*) MM Diamonds

Author Message
darthmite

Senior Member

Joined: 20/11/2011
Location: France
Posts: 240
Posted: 02:54pm 29 Feb 2012
Copy link to clipboard 
Print this post

Hi all ,

Here is a preview from my next little game
This time , like boulder dash or Rocks & Diamonds games you have to collect
all Diamonds in a level before you can go into the next one.
Actually the output door has no effect , the Hero cant die and go
to the next level when the last diamond is collected.
It's still allot to do for finish but i have want let you all test
it
I get the sprites graphics from this free game : Rocks & Diamonds .
Then converted them to B/W and finally cut all to made the Sprites font.

The control is easy ... the 4 directions keys or the 'Standard' MM joystick.

Here are some pics :





























The source code :

2012-03-01_020425_MMDiam.zip

I will release the Level editor written in Delphi soon.
You will see that with the joystick it work better , but i added the keyboard
that every can test.

Cheers.
Edited by darthmite 2012-03-02
Theory is when we know everything but nothing work ...
Practice is when everything work but no one know why ;)
 
vasi

Guru

Joined: 23/03/2007
Location: Romania
Posts: 1697
Posted: 04:54pm 29 Feb 2012
Copy link to clipboard 
Print this post

Great job Darthmite, I have this game on Linux, I'm playing it with or without my daughter :) .
Hobbit name: Togo Toadfoot of Frogmorton
Elvish name: Mablung Miriel
Beyound Arduino Lang
 
darthmite

Senior Member

Joined: 20/11/2011
Location: France
Posts: 240
Posted: 07:16pm 20 Apr 2012
Copy link to clipboard 
Print this post

Hi

I have improve the game.
Added the monsters , dynamites and some 'beeps'
The level editor is finished too 'write in Delphi'
Here is the game :
2012-04-21_050713_diamond.zip

Here is the Level editor :




2012-04-21_050805_MMDiam_Delphi.zip

And here is a little PDF to explain the editor ...
2012-04-21_050846_MMDiam_Level_Editor.pdf

It work on MM Basic v3.2.
The controls are done with a 'Atari' like joystick or the Keyboard.
You can add a nunchuck routine if you don't want use the joy or the KB.
With this game i reach the speed limit from the MM Basic graphics.
You will see this yourself in the Level 4
For a next game i will wait until some more optimizations are done ...

Enjoy.


Theory is when we know everything but nothing work ...
Practice is when everything work but no one know why ;)
 
Raros

Regular Member

Joined: 06/02/2012
Location: Italy
Posts: 55
Posted: 08:35pm 20 Apr 2012
Copy link to clipboard 
Print this post

Thanks Darthmite. He he he good memories......
 
Geoffg

Guru

Joined: 06/06/2011
Location: Australia
Posts: 3194
Posted: 02:16am 21 Apr 2012
Copy link to clipboard 
Print this post

Another great game. I love it when the dynamite goes off!!
I am still trying to figure out the rules, seems that when you let off the dynamite you can also run away to avoid the blast. Then, you have a pile of more diamonds to harvest.

Geoff
Geoff Graham - http://geoffg.net
 
darthmite

Senior Member

Joined: 20/11/2011
Location: France
Posts: 240
Posted: 03:55am 21 Apr 2012
Copy link to clipboard 
Print this post

True Geoff

Better to go away when you drop a dynamite or ... you die
The rules are simple , get all diamonds from the level for start the
next level.
The dynamite are just supposed to destroy the walls who block some of
the diamonds
Now to kill a monster , just let a rocks fall on it and run away because
the monster is going to explode.
I don't know if you can optimize the interpreter that the level 4
run faster (the one with only 1 diamond and allot rocks falling down).
Just try to move when the level start and you will see what i mean.
This one was a test level for see if the interpreter was able to manage
full of sprites fast enough.

Cheers.

Theory is when we know everything but nothing work ...
Practice is when everything work but no one know why ;)
 
Bill.b

Senior Member

Joined: 25/06/2011
Location: Australia
Posts: 226
Posted: 10:16am 21 Apr 2012
Copy link to clipboard 
Print this post

Hi Fabrice

great game I had a similar game on my MicroBee back in the 80's.

had to disable lines 175 - 179 (joy stick inputs) as they made the keyboard
input erradict, possibly due to floating input pins.

regards Bill
In the interests of the environment, this post has been constructed entirely from recycled electrons.
 
darthmite

Senior Member

Joined: 20/11/2011
Location: France
Posts: 240
Posted: 11:37am 21 Apr 2012
Copy link to clipboard 
Print this post

  Bill.b said  

had to disable lines 175 - 179 (joy stick inputs) as they made the keyboard
input erradict, possibly due to floating input pins.



good to know this bug , here i play it with the 'Atari' like joy connected then
the input are all at '3.3v' when i use the KB.
I think i go for made a menu to choose between joy or kb like Nick do with
the great PacMan game

Cheer.

Theory is when we know everything but nothing work ...
Practice is when everything work but no one know why ;)
 
darthmite

Senior Member

Joined: 20/11/2011
Location: France
Posts: 240
Posted: 01:10pm 21 Apr 2012
Copy link to clipboard 
Print this post

Hi ,

So ... now i added a menu to select the controller you want use like
Nick do with Pacman
You can then choose the joystick , Nunchuck or Keyboard.

The MaxLevel variable is now on top of the file that you don't have
to search it in the code when you add levels to the game.

Here it is :
2012-04-21_230907_diamond.zip

Enjoy.

Theory is when we know everything but nothing work ...
Practice is when everything work but no one know why ;)
 
Nick

Guru

Joined: 09/06/2011
Location: Australia
Posts: 512
Posted: 11:37pm 21 Apr 2012
Copy link to clipboard 
Print this post

Very good Darthmite! Good to see people creating useful and entertaining software for the Maximite.

I had to update to MMbasic 3.2 (would have done it anyway) because it didn't have enough memory available under 3.1.

A bit more speed would be nice. I would have liked just a bit more for MaxMan but we are runnning in interpretive BASIC after all.

Anyone tried overclocking the PIC32?

Nick

Edited by Nick 2012-04-23
 
darthmite

Senior Member

Joined: 20/11/2011
Location: France
Posts: 240
Posted: 12:54am 22 Apr 2012
Copy link to clipboard 
Print this post

Yep Nick ,

For be faster they are not allot solution.
MM Basic compiler (not enough RAM for that on the PIC32)
Geoff have made good optimization but a interpreter still
run slow.
Just for made the Level 4 from the game faster it have to run
something like 4 or 5x faster to be able to manage all the
maths and graphics.The over-clocking will then not help
Another way will be to use typed variable that we don't have to use
32bits for everything , we can then run a little faster.
The Sprites ( Fonts ) memory block exchange to the video memory have
to be faster to not slow the rest of the game too ...
We are now to the point that we can really see what is to do to
improve the MM Basic interpreter

The Force be with Geoff for That

Cheers.

Theory is when we know everything but nothing work ...
Practice is when everything work but no one know why ;)
 
Geoffg

Guru

Joined: 06/06/2011
Location: Australia
Posts: 3194
Posted: 02:01am 22 Apr 2012
Copy link to clipboard 
Print this post

I have the ability to profile a running program and see where is is spending most of its time so I will try that with Diamonds and MaxMan.

It might show where I could optimise the interpreter to suit games like this but I don't think that we will get a 4x or 5x speed increase. I have employed the profiler a lot in the past to tweak MMBasic so I have already optimised the obvious places. For example in 3.2 the interpreter does a scan of the program before running and builds a table for all the Subs, Functions and Labels so that when you call one of them the interpreter can jump direct to the location in the program (it does not have to scan through the program to find it).

Some people have tested overclocking of the PIC32 and they have run it at up to 120MHz (50% faster) but it does run very hot at that speed. The PIC32 has the neat feature of being able to change its speed on the fly so perhaps it would be worth adding a command that could speed it up for games or slow it down to reduce power consumption.

All stuff for a future version I guess.

Geoff
Geoff Graham - http://geoffg.net
 
Nick

Guru

Joined: 09/06/2011
Location: Australia
Posts: 512
Posted: 08:24am 22 Apr 2012
Copy link to clipboard 
Print this post

A command to speed it up it the crucial parts of the code would certainly help.

This way, the Pic32 is not always at turbo speed.

I remember the old TRS-80 Basic had a command to declare variables as single or double precision. This was used to speed up calculations in areas where the math is only basic (counters).

I'm still hanging out for a LOADBMP.

Nick
 
Print this page


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

© JAQ Software 2024