Pacman on an 8x8 LED Matrix

Post here to let others know of a project you're working on.

Moderators: Chuckt, Garth, bitfogav

User avatar
brad
Site Admin
Site Admin
Posts: 2578
Joined: Fri Mar 26, 2010 10:30 pm
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1266: count(): Parameter must be an array or an object that implements Countable

Post by brad » Fri Aug 20, 2010 10:34 pm

Okay, I am at a point where I can upload a video to youtube. The only problem is that I am tired and want to goto bed. So I will upload the video clip tomorrow.

The only things needed to make this a complete game are:

:arrow: High Score table
:arrow: Pellets to eat
:arrow: More level maps

And I guess that's about it. I have a few levels programmed in, there are five bad guys per level and the LCD shows you your lives, level you are on and your score. You can then press the select button to cycle through the LCD menu to show you different debug features and "cheats" like level select.

Basic programming has made this game, well, basic to make!

User avatar
brad
Site Admin
Site Admin
Posts: 2578
Joined: Fri Mar 26, 2010 10:30 pm
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1266: count(): Parameter must be an array or an object that implements Countable

Post by brad » Sun Aug 22, 2010 9:30 pm

I know I said I would upload a video, and I did take some video but the quality is really poor and blurry - so I am looking at buying a new camera tomorrow and I'll see how that goes. :D

User avatar
bitfogav
Moderator
Moderator
Posts: 915
Joined: Sun Mar 28, 2010 9:03 pm
Location: United Kingdom
Contact:

Post by bitfogav » Sun Aug 22, 2010 10:37 pm

Looking forward to seeing how its come out :D and the final code with the LCD display :)

User avatar
brad
Site Admin
Site Admin
Posts: 2578
Joined: Fri Mar 26, 2010 10:30 pm
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1266: count(): Parameter must be an array or an object that implements Countable

Post by brad » Mon Aug 23, 2010 9:02 pm

bitfogav wrote:Looking forward to seeing how its come out :D and the final code with the LCD display :)
Well I have to wait a few more days for the new camera - sorry.

BUT, how about I paste the LCD code (as it is at the moment)

Code: Select all

Sub draw_lcd()
    If button_debounce = 0 And nes_select = 0 Then
        LCD.Cls
        button_debounce = 15
        Inc(menu_cycle)
        If menu_cycle = 4 Then
            menu_cycle = 0
        EndIf
    EndIf
    Select menu_cycle
        Case 0            
            LCD.WriteAt(1,1,"   P A C M A N   ")
            LCD.WriteAt(2,1,"By Brad Slattery")
        Case 1
            LCD.WriteAt(1,1,"Stage=",Convert.DecToStr(current_stage,2)," Lives=",Convert.DecToStr(lives,1)) 
            LCD.WriteAt(2,1,"Score=",Convert.DecToStr(score,5))
        Case 2
            LCD.WriteAt(1,1,"Buttons RLDUSSBA") 
            LCD.WriteAt(2,1,"Status  ",Convert.BinToStr(nes_flags,8))
        Case 3
            If nes_up = 0 And button_debounce = 0 And current_stage < 2 Then
                Inc(current_stage)
                button_debounce = 15
            ElseIf nes_down = 0 And button_debounce = 0 And current_stage > 0 Then
                Dec(current_stage)
                button_debounce = 15
            EndIf
            LCD.WriteAt(1,1,"Stage") 
            LCD.WriteAt(2,1,"Select = ",Convert.DecToStr(current_stage,2))
    End Select          
End Sub
It is a really basic setup here, it checks if the select button has been pressed, if it has - it clears the screen, changes to the next menu number (of which there are four at the moment 0 to 3). It will then display the relevant data on the LCD display which is dependant upon the number stored in menu_cycle.

User avatar
bitfogav
Moderator
Moderator
Posts: 915
Joined: Sun Mar 28, 2010 9:03 pm
Location: United Kingdom
Contact:

Post by bitfogav » Mon Aug 23, 2010 9:48 pm

Basic language really makes this so much easier, to write that in assembly language would of needed alot more code.. And you even have to write all the LCD commands, the basic language modules do it all for you :)

User avatar
brad
Site Admin
Site Admin
Posts: 2578
Joined: Fri Mar 26, 2010 10:30 pm
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1266: count(): Parameter must be an array or an object that implements Countable

Post by brad » Tue Aug 24, 2010 10:02 pm

bitfogav wrote:Basic language really makes this so much easier, to write that in assembly language would of needed alot more code.. And you even have to write all the LCD commands, the basic language modules do it all for you :)
You said it bitfogav! Basic makes things so much easier. Instead of pulling your hair out trying to figure out all the nitty gritty in assembly, you can get straight to the task at hand using basic. It's just fantastic!

Apparantly my new camera will turn up in the next couple of days. It is supposed to take HD video so hopefully it does a good job of it :D

User avatar
brad
Site Admin
Site Admin
Posts: 2578
Joined: Fri Mar 26, 2010 10:30 pm
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1266: count(): Parameter must be an array or an object that implements Countable

Post by brad » Thu Aug 26, 2010 10:40 pm

The video is DONE I tell you, I just can't upload for some strange reason :(

I have tried to upload it three times now but it gets about 1/4 of the way through and then freezes.

I will try from work tomorrow and see how that goes.

User avatar
brad
Site Admin
Site Admin
Posts: 2578
Joined: Fri Mar 26, 2010 10:30 pm
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1266: count(): Parameter must be an array or an object that implements Countable

Post by brad » Fri Aug 27, 2010 9:17 pm

FINALLY - I HAVE IT UPLOADED!

The quality is not the best but you can get the idea, here it is:


User avatar
bitfogav
Moderator
Moderator
Posts: 915
Joined: Sun Mar 28, 2010 9:03 pm
Location: United Kingdom
Contact:

Post by bitfogav » Sun Aug 29, 2010 9:34 pm

brad wrote:FINALLY - I HAVE IT UPLOADED!

WoW!! thats amazing Brad, lots of wires on that board and the 8x8 RGB matrix looks great.

User avatar
brad
Site Admin
Site Admin
Posts: 2578
Joined: Fri Mar 26, 2010 10:30 pm
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1266: count(): Parameter must be an array or an object that implements Countable

Post by brad » Sun Aug 29, 2010 9:57 pm

bitfogav wrote:
brad wrote:FINALLY - I HAVE IT UPLOADED!

The quality is not the best but you can get the idea, here's the link:

http://www.youtube.com/watch?v=M1MeP4wHgKg

WoW!! thats amazing Brad, lots of wires on that board and the 8x8 RGB matrix looks great.
I am a little bummed about the poor video quality which gives a lot of ghosting on the screen. But I will certainly look at making a better version.

I will also make it into some sort of project box, I just have to find something suitable.

User avatar
bitfogav
Moderator
Moderator
Posts: 915
Joined: Sun Mar 28, 2010 9:03 pm
Location: United Kingdom
Contact:

Post by bitfogav » Thu Sep 02, 2010 6:17 am

Heres something Brad that I think you might like! :D hehe!!


User avatar
brad
Site Admin
Site Admin
Posts: 2578
Joined: Fri Mar 26, 2010 10:30 pm
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1266: count(): Parameter must be an array or an object that implements Countable

Post by brad » Thu Sep 02, 2010 10:17 pm

Very good :) Nice little animation!

Can you post your code?

User avatar
bitfogav
Moderator
Moderator
Posts: 915
Joined: Sun Mar 28, 2010 9:03 pm
Location: United Kingdom
Contact:

Post by bitfogav » Fri Sep 03, 2010 2:17 am

brad wrote:Very good :) Nice little animation!

Can you post your code?
I will post my code in a new forum post in the programming in swordfish basic :)
I cant do all of the code as it will fill prob use 20 pages hehe..

User avatar
brad
Site Admin
Site Admin
Posts: 2578
Joined: Fri Mar 26, 2010 10:30 pm
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1266: count(): Parameter must be an array or an object that implements Countable

Post by brad » Fri Sep 03, 2010 10:02 pm

20 pages :shock:

I hope there's alot of copying / pasting involved there!

User avatar
bitfogav
Moderator
Moderator
Posts: 915
Joined: Sun Mar 28, 2010 9:03 pm
Location: United Kingdom
Contact:

Post by bitfogav » Fri Sep 10, 2010 5:32 am

Hey Brad hows the PacMan game going? :)

I have some more questions for you, this bit of code from your pacman game:

Code: Select all

Sub check_for_walls() 
    For x = 0 To 7 
        If character_x_position = x Then 
            If wall_data_above.bits(x) = 1 Then 
                wall_up = 1 
            ElseIf wall_data_above.bits(x) = 0 Then 
                wall_up = 0 
            EndIf 
            If wall_data_below.bits(x) = 1 Then 
                wall_down = 1 
            ElseIf wall_data_below.bits(x) = 0 Then 
                wall_down = 0 
            EndIf 
        EndIf 
    Next 
                    
    For x = 0 To 6 
        If character_x_position = (x) And wall_data.bits(x + 1) = 1 Then           // these first two check for 
            wall_left = 1                                                               // walls to the left 
        ElseIf character_x_position = (x) And wall_data.bits(x + 1) = 0 Then                                              
            wall_left = 0 
        ElseIf character_x_position = (x + 1) And wall_data.bits(x) = 1 Then       // these next two check for walls 
            wall_right = 1                                                              // to the right 
        ElseIf character_x_position = (x + 1) And wall_data.bits(x) = 0 Then 
            wall_right = 0 
        EndIf 
    Next 
End Sub
I see you are checking to see if your character has hit a wall by checking each bit, when I use
".bit" to check a bit say in a byte of data? swordfish will not let me compile it :? is ".bit" a swordfish command? Or have you declared this somewhere else :?

Post Reply
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1266: count(): Parameter must be an array or an object that implements Countable

Who is online

Users browsing this forum: No registered users and 2 guests