News:

Who uses forums anymore?

Main Menu

[VB] Reincarnation of Pacman!

Started by Joe, December 08, 2005, 07:39:09 PM

Previous topic - Next topic

0 Members and 2 Guests are viewing this topic.

Joe

http://www.javaop.com/~joe/rop/

Yeah. I'm up to the challenge (to some degree) of rewriting Pacman. I had the idea today in computer programming (I spent four hours out of seven in that lab, and had one good idea. Ugh.), and just had to do it.

Anyhow, I wrote clsScreen to hold a grid, 32x32 spaces, and procedures to move each square up down left and right, to set the value, to get the value, and to swap two positions. I've got modScreen which handles drawing this grid to a 32x32 control array of borderless frames on frmMain, which will later be used to hold images representing the players, vitamin pills, etc. Right now, the grid is holding a long, which is set to a random color in Form_Load. The sad part, this takes a good two seconds to load on a 2.8Ghz processor. Of course, its creating 32x32 controls, setting three values on each of them, filling up an array of 32x32 elements, reading them again, and then setting the read values to the BackColor of the frame. Lets see you do that in two seconds. Oh well, you'll live.

Random Color EXE
Random Color Screenshot.
Quote from: Camel on June 09, 2009, 04:12:23 PMI'd personally do as Joe suggests

Quote from: AntiVirus on October 19, 2010, 02:36:52 PM
You might be right about that, Joe.


Joe

I have such vivid memories of pacman, that I managed to remember where most of the lines go!
Quote from: Camel on June 09, 2009, 04:12:23 PMI'd personally do as Joe suggests

Quote from: AntiVirus on October 19, 2010, 02:36:52 PM
You might be right about that, Joe.


rabbit


Warrior

#3
Wow...use GDI. That or DirectDraw or Direct3D for 2D drawing or something anything better than controls..
One must ask oneself: "do I will trolling to become a universal law?" And then when one realizes "yes, I do will it to be such," one feels completely justified.
-- from Groundwork for the Metaphysics of Trolling

MyndFyre

I think GDI+ will do nicely for you.  GDI+ is the unmanaged API wrapped by the .NET Framework's drawing tools (in the System.Drawing namespace).  It provides an excellent and broad range of drawing tools.

http://msdn.microsoft.com/library/?url=/library/en-us/gdicpp/GDIPlus/GDIPlusreference/flatapi.asp?frame=true

Assuming you're using VB, you'll need to use the flat API (which is what I linked you to) instead of the object-oriented equivalent.

Joe, if you're going to use VB, at least use VB.NET and learn something about object orientation! :P
Quote from: Joe on January 23, 2011, 11:47:54 PM
I have a programming folder, and I have nothing of value there

Running with Code has a new home!

Quote from: Rule on May 26, 2009, 02:02:12 PMOur species really annoys me.