Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 Insectoid's PacMan blog
Index -> Programming, Turing -> Turing Submissions
Goto page 1, 2  Next
View previous topic Printable versionDownload TopicRate TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
Insectoid




PostPosted: Thu May 08, 2008 8:17 am   Post subject: Insectoid's PacMan blog

So, I decided to start a blog on my work on PacMan. I am expecting 1-2 weeks more work. I will update frequently (usually daily) and ask for help in this post.

Completed to date:

-All images
-Movement
-collision detection
-'Automated coin drawing procedure'
-The Cherry
-Mouth open/close animation
-Points system

Need to do:

-All sounds- If someone has unpolluted pacman sounds, could you post them?
-Ghost AI- Going to need help with this
-Intro/Game over screens
-Ghost 'Oh no! you can eat me now!"
-High Scores
-Adjust movement to pac-man style (never stops)
-'pacman dead' animation

UPDATE: I got some basic AI working now, but there is so much for the computer to check that it is EXTREMELY laggy!
I have it
-Checking for coin collision
-Checking for cherry collision
-Checking for wall collision
-Checking for Ghost wall collision
-Checking for ghost AI
-Checking for mouth open/close
Here are the things I HAVEN'T done yet and need to do!

-Checking for pacman/ghost collision
-Checking for banana colision (instantly makes the ghosts edible)
-Checking for edible ghost collision

Does it have something to do with me checking with whatdotcolor for everything except sprite-on-sprite action?

Help?



PacMan.rar
 Description:
Pacman- May 8

Download
 Filename:  PacMan.rar
 Filesize:  83.71 KB
 Downloaded:  434 Time(s)

Sponsor
Sponsor
Sponsor
sponsor
Michael516




PostPosted: Fri May 09, 2008 7:36 am   Post subject: RE:Insectoid\'s PacMan blog

this is a neat game, but there is one problem, there is just barely enough room for him to fit through so I get stuck on corners a lot.
nastynika




PostPosted: Fri May 09, 2008 8:03 am   Post subject: Re: Insectoid's PacMan blog

nice job so far i will try to make so adjustments for u and repost it so u can continue adding on to it
Insectoid




PostPosted: Fri May 09, 2008 10:10 am   Post subject: Re: Insectoid's PacMan blog

Update! I finished putting in a bunch of sounds, though I need a new background one (The one I have sounds like crap)

Also, it tells you how many coins are left (rouph version) and there are 'win' and 'lose' procedures. But as you can only win thus far, you will never get to see the 'lose' proc unless you take it out and test it on its own.

Enjoy!

EDIT: I put in a countdown timer that gives you 2000 seconds to get all the coins (well, 200 seconds because of lag) , so now you can lose and win! If you win, it seems you have to click on another window before it will give you the rough draft of my 'you win!' screen.

Once again, Enjoy!



PacMan.zip
 Description:
Paman- May 9 (V2)

Download
 Filename:  PacMan.zip
 Filesize:  2.64 MB
 Downloaded:  243 Time(s)

Insectoid




PostPosted: Mon May 12, 2008 4:48 pm   Post subject: Re: Insectoid's PacMan blog

Update!
I got the rediculously simple AI back in, but there is a problem. It only shows a blank screen, until you terminate the program.
Thus, I have not been able to see if it works. In theory, it should. Pathfinding seems like a cool thing to boost my marks, and I notice there is no tutorial on it (Unless it's hiding from me, they do that sometimes...)

If someone has an example of pathfinding AI, could you show me, so that I can stop hating myself for not knowing?

I realized while working that my pacman death animation BooHoo only works if your pointing in a certain direction (left). This is a stupid mistake to be fixed once I feel like it (once all the cool bits are out of the way)

Just out of curiosity, what is the bits system for? What can you do with bits? Are they for bragging rights?

Anyway, Here's the newest edition of PacMan- Jordan style

EDIT: I noticed I forgot a line of code in the AI procedure (Sprite.Animate) and so that's fixed. Still have some trouble with the whole 'blank screen thing'. I also cleaned up my code a bit, so you can read it better.

New problem: 'Sprite was freed'. I didn't free it myself, must be an automatic feature in turing. Could someone explain this?
New feature: The one ghost I have in the game now will occasionally turn dark blue, meaning he's edible. This has no impact on the game (YET!) so if you run into him (after you fix the bugs I don't know how to fix) nothing will happen. This will be done soon...



PacMan.zip
 Description:
Pacman- May 12 (V2)

Download
 Filename:  PacMan.zip
 Filesize:  2.62 MB
 Downloaded:  225 Time(s)

Insectoid




PostPosted: Mon May 12, 2008 8:57 pm   Post subject: Re: Insectoid's PacMan blog

Okay, I've been working on the high scores right now.

This here is my code for putting the new high score in the right place. I'm sure there is a better way that doesn't use 100 lines, but that is beyond my current knowledge.

Turing:

%High scores

var newhighscore : int := 3700
var newname : string := "This works!"
var scorelist : int

type highscore :
    record
        name : string
        score : int
    end record

var highscores2 : array 1 .. 10 of highscore

open : scorelist, "Scorelist.in", get

for collect : 1 .. 10
    get : scorelist, highscores2 (collect).score
    get : scorelist, highscores2 (collect).name
end for

if newhighscore > highscores2 (1).score then
    highscores2 (10) := highscores2 (9)
    highscores2 (9) := highscores2 (8)
    highscores2 (8) := highscores2 (7)
    highscores2 (7) := highscores2 (6)
    highscores2 (6) := highscores2 (5)
    highscores2 (5) := highscores2 (4)
    highscores2 (4) := highscores2 (3)
    highscores2 (3) := highscores2 (2)
    highscores2 (2) := highscores2 (1)
    highscores2 (1).score := newhighscore
    highscores2 (1).name := newname

elsif newhighscore > highscores2 (2).score then
    highscores2 (9) := highscores2 (8)
    highscores2 (8) := highscores2 (7)
    highscores2 (7) := highscores2 (6)
    highscores2 (6) := highscores2 (5)
    highscores2 (5) := highscores2 (4)
    highscores2 (4) := highscores2 (3)
    highscores2 (3) := highscores2 (2)
    highscores2 (2).score := newhighscore
    highscores2 (2).name := newname

elsif newhighscore > highscores2 (3).score then
    highscores2 (8) := highscores2 (7)
    highscores2 (7) := highscores2 (6)
    highscores2 (6) := highscores2 (5)
    highscores2 (5) := highscores2 (4)
    highscores2 (4) := highscores2 (3)
    highscores2 (3).score := newhighscore
    highscores2 (3).name := newname

elsif newhighscore > highscores2 (4).score then
    highscores2 (7) := highscores2 (6)
    highscores2 (6) := highscores2 (5)
    highscores2 (5) := highscores2 (4)
    highscores2 (4).score := newhighscore
    highscores2 (4).name := newname

elsif newhighscore > highscores2 (5).score then
    highscores2 (6) := highscores2 (5)
    highscores2 (5).score := newhighscore
    highscores2 (5).name := newname

elsif newhighscore > highscores2 (6).score then
    highscores2 (10) := highscores2 (9)
    highscores2 (9) := highscores2 (8)
    highscores2 (8) := highscores2 (7)
    highscores2 (7) := highscores2 (6)
    highscores2 (6).score := newhighscore
    highscores2 (6).name := newname

elsif newhighscore > highscores2 (7).score then
    highscores2 (10) := highscores2 (9)
    highscores2 (9) := highscores2 (8)
    highscores2 (8) := highscores2 (7)
    highscores2 (7).score := newhighscore
    highscores2 (7).name := newname

elsif newhighscore > highscores2 (8).score then
    highscores2 (10) := highscores2 (9)
    highscores2 (9) := highscores2 (8)
    highscores2 (8).score := newhighscore
    highscores2 (8).name := newname

elsif newhighscore > highscores2 (9).score then
    highscores2 (10) := highscores2 (9)
    highscores2 (9).score := newhighscore
    highscores2 (9).name := newname

elsif newhighscore > highscores2 (10).score then
    highscores2 (10).name := newname
    highscores2 (10).score := newhighscore
end if


for x : 1 .. 10
    put highscores2 (x).name : 20, highscores2 (x).score
end for


And here is my base list with scores to beat


Scorelist.in
code:

6000         "Clyde"
5500         "Blinky"
5000         "Inky"
4500         "Pinky"
0000         "NONE"
0000         "NONE"
0000         "NONE"
0000         "NONE"
0000         "NONE"
0000         "NONE"


My main question is, how can I import this into my main program (see previous post) and change Scorelist.in to reflect the new list as created by the huge 100 line code (highscores.t)
syntax_error




PostPosted: Mon May 12, 2008 11:13 pm   Post subject: Re: Insectoid's PacMan blog

use for loops to loop through the array indices and to replace values, much less lines of code.
Insectoid




PostPosted: Tue May 13, 2008 8:03 am   Post subject: RE:Insectoid\'s PacMan blog

Well, I tried a for loop, and it doesn't work. I get the message 'array subscript is out of range". No you're probably reading this and saying 'holy crap this guy is dumb' but I am only in gr. 10, we have not done arrays yet, and we will not be doing records, so you can see, this is very new to me.

Turing:

var newhighscore : int := 6500
var newname : string := "PacMan"
var scorelist : int


type namesandscores :
    record
        name : string
        score : int
    end record

var highscores : array 1 .. 10 of namesandscores

open : scorelist, "scorelist.in", get


for sort : 1 .. 10
    get : scorelist, highscores (sort).score
    get : scorelist, highscores (sort).name
   
    if newhighscore > highscores (sort).score then
        newhighscore := highscores (sort).score
        newname := highscores (sort).name
    end if
   
    highscores (sort) := highscores (sort + 1)


end for

for display : 1 .. 10
    put highscores (display).name : 20, highscores (display).score
end for


Still wondering how to replace names & numbers in 'scorelist.in'. Help?
Sponsor
Sponsor
Sponsor
sponsor
Insectoid




PostPosted: Tue May 13, 2008 6:41 pm   Post subject: RE:Insectoid\'s PacMan blog

I got all the ghost collisions done, but I'm not going to post them as it is such a small update. My progress is going very slow as the whole 'not displaying anything' bug still hasn't been fixed...or the 'sprite was freed' bug. I noticed that when I put the sprite declarations into the procedure, that did not happen. Of course, that way I reach the max number of sprites (1000) in a second.

Help is still apreciated.
Insectoid




PostPosted: Thu May 15, 2008 6:27 pm   Post subject: RE:Insectoid\'s PacMan blog

No more updates until the problems are fixed.
Insectoid




PostPosted: Sat May 17, 2008 8:21 pm   Post subject: Re: Insectoid's PacMan blog

Yes, I know, I said no more update!s, but I couldn't resist!

I have added in a menu and a pre-game animation. For some reason if flickers, but I have set it to offscreenonly and used View.Update.

Looking back at my original post in this thread, I find that all I have left to do is the high scores, movement adjustment, and fix the 'you're dead' bit! That and fix the 2 bugs in the game...
even If I get a grade of 300% on this project, I will still not be happy unless that second glitch (The 'sprite was freed' glitch) is fixed (The other seems to have repaired itself with the menu)

So, Here is my current version of PacMan!

EDIT: I put in some extra sounds (for the menu) and slowed down the animation so it is as long as the intro song. Also changed the intro from WAV to MP3 so that it doesn't cut out when you select something from the menu.



PacMan.zip
 Description:
PacMan- May 17 (V2)

Download
 Filename:  PacMan.zip
 Filesize:  2.7 MB
 Downloaded:  275 Time(s)

death bringer




PostPosted: Fri May 30, 2008 9:17 am   Post subject: RE:Insectoid\'s PacMan blog

It's an ok game but you really need to work on the computers AI becasue once they start casesing you they dont sto. also the postion of the dots isn't the best maybe try aligning them more. lastly play the original pacman and try to add thing like the fruit and attempt to make the ghost blink once or twice before they stop runing away from you. lastly if you want to go all out add music to the background using maybe

process BackgroundMusic
loop
play ("")
end loop
end BackgroundMusic
Insectoid




PostPosted: Sat May 31, 2008 8:43 am   Post subject: RE:Insectoid\'s PacMan blog

I had that, but it got annoying so I turned it off. I have played the original pacman many times to try and get this one right. I assume you downloaded the first one? And it worked? The ghosts actually worked? what did you do to fix it?

The positioning of the dots is perfect, actually, which you may have noticed if you downloaded the newest version.

There are fruit, if you didn't notice. it gives you 100 points. The 'ghost get sick' fruit is actually a large coin, maybe you should try playing the original pacman.


Have you read the entire thread yet? That would be usefull, as right now, your post is considered spam (http://en.wikipedia.org/wiki/Spam_(electronic))

EDIT
- seems the url won't work...

edit: fixed url with html text instead of bbcode Wink
TheWanderer




PostPosted: Sat May 31, 2008 11:41 am   Post subject: Re: RE:Insectoid\'s PacMan blog

insectoid @ Tue May 13, 2008 8:03 am wrote:
Still wondering how to replace names & numbers in 'scorelist.in'. Help?


This looks a lot like the sorting I used for my FP game.

to update the score text file I read them off the file, and into the array like you did,
then immediately close the file ID.

in your case,
close : scorelist

now Turing is not accessing that file.

after sorting it with your game scores,
open that file again with a new int ID, and then write your new array back into it,
then close it a second time

works for me.

btw please check my game for an example of score sorting, thanks!
Insectoid




PostPosted: Sat May 31, 2008 2:02 pm   Post subject: RE:Insectoid\'s PacMan blog

so if I write back into it that way, it will erase the contents and put in the new stuff? That's what I'm after (Or just replacing...)
Display posts from previous:   
   Index -> Programming, Turing -> Turing Submissions
View previous topic Tell A FriendPrintable versionDownload TopicRate TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 2  [ 18 Posts ]
Goto page 1, 2  Next
Jump to:   


Style:  
Search: