Author Topic: [VB] Reincarnation of Pacman!  (Read 3812 times)

0 Members and 1 Guest are viewing this topic.

Offline Joe

  • B&
  • Moderator
  • Hero Member
  • *****
  • Posts: 10319
  • In Soviet Russia, text read you!
    • View Profile
    • Github
[VB] Reincarnation of Pacman!
« on: December 08, 2005, 07:39:09 pm »
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.
I'd personally do as Joe suggests

You might be right about that, Joe.


Offline Joe

  • B&
  • Moderator
  • Hero Member
  • *****
  • Posts: 10319
  • In Soviet Russia, text read you!
    • View Profile
    • Github
Re: [VB] Reincarnation of Pacman!
« Reply #1 on: December 08, 2005, 09:06:04 pm »
I have such vivid memories of pacman, that I managed to remember where most of the lines go!
I'd personally do as Joe suggests

You might be right about that, Joe.


Offline rabbit

  • x86
  • Hero Member
  • *****
  • Posts: 8092
  • I speak for the entire clan (except Joe)
    • View Profile
Re: [VB] Reincarnation of Pacman!
« Reply #2 on: December 09, 2005, 09:14:13 am »
In all 255 levels?

Offline Warrior

  • supreme mac daddy of trolls
  • Hero Member
  • *****
  • Posts: 7503
  • One for a Dime two for a Quarter!
    • View Profile
Re: [VB] Reincarnation of Pacman!
« Reply #3 on: December 13, 2005, 08:27:09 pm »
Wow...use GDI. That or DirectDraw or Direct3D for 2D drawing or something anything better than controls..
« Last Edit: December 13, 2005, 08:49:25 pm by MyndFyre[x86] »
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

Offline MyndFyre

  • Boticulator Extraordinaire
  • x86
  • Hero Member
  • *****
  • Posts: 4540
  • The wait is over.
    • View Profile
    • JinxBot :: the evolution in boticulation
Re: [VB] Reincarnation of Pacman!
« Reply #4 on: December 14, 2005, 11:15:12 am »
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
I have a programming folder, and I have nothing of value there

Running with Code has a new home!

Our species really annoys me.