Jump to content


Small Windows Game


11 replies to this topic

#1 Gendramen

    Member

  • Members
  • PipPip
  • 52 posts

Posted 31 October 2004 - 02:35 PM

Hi.. Im making a small windos app with the lamm name: Cakedude,
the idee ist just to make a simpel Pacman game.. i never did Window games, zo i get the first problem.. :wacko:

All my code is in the same .cs, the name is Form1.
I have a Small PictureBox that can be controlt with te Up, Down, Left end Richt Keys.. :lol:

But now the problem.. Look, this my Form.
Posted Image
And dude (that thing) he is going left..
Posted Image

How i can make dude conineu his journey?.. How can i make hem Spam him to the Rightside of the Form?

#2 NomadRock

    Senior Member

  • Members
  • PipPipPipPip
  • 785 posts

Posted 31 October 2004 - 06:57 PM

if(x < 0) x = X_MAX;
Jesse Coyle

#3 Gendramen

    Member

  • Members
  • PipPip
  • 52 posts

Posted 01 November 2004 - 01:27 PM

Im stupid.. :wacko:
The game is in C#..


Wat means X_Max?

#4 Mihail121

    Senior Member

  • Members
  • PipPipPipPip
  • 1059 posts

Posted 01 November 2004 - 01:38 PM

Ahhhhh... the good old Visual Basic memories are comming back as i coded my first game: "Shoot the fishes". Boy i loved that game!

#5 bladder

    DevMaster Staff

  • Members
  • PipPipPipPip
  • 1057 posts

Posted 01 November 2004 - 02:05 PM

X_MAX would be the width of your drawing area. So when dude's x position went below zero, you'd set his position to X_MAX so that it looks like he ewnt around the world and popped out the other end.

#6 Gendramen

    Member

  • Members
  • PipPip
  • 52 posts

Posted 01 November 2004 - 02:14 PM

mm. oke thnx.. next thing to do.. the Dots.. ( or cake :cool: ) ..

#7 NomadRock

    Senior Member

  • Members
  • PipPipPipPip
  • 785 posts

Posted 01 November 2004 - 06:08 PM

same thing in reverse as well, if the guy's position is more than the maximum, you set it to zero.
Jesse Coyle

#8 Gendramen

    Member

  • Members
  • PipPip
  • 52 posts

Posted 03 November 2004 - 01:54 PM

Yes.. i know that now.... but Up and Down (Down und Up).. Don;t Work that way..

i have trying:

	if (this.PicDude.Location.Y >= 5)
         {
this.PicDude.Location =   new System.Drawing.Point(this.PicDude.Location.X , this.PicDude.Location.Y + 5 );
          }

.. Walking in the good way? or lost? :huh:

#9 Ed Mack

    Senior Member

  • Members
  • PipPipPipPip
  • 1239 posts

Posted 03 November 2004 - 03:46 PM

I'm not familiar with System.Drawing, but why do you refer to this.PicDude.Location.X ?

Does the system alllow you to do this.PicDude.Location.Y -= 5; ?

#10 Gendramen

    Member

  • Members
  • PipPip
  • 52 posts

Posted 04 November 2004 - 02:34 PM

Nope.. -= isn't good i think...

Ther was some dude tell me it can with: "This.Weigt" ... i have try it.. but can get it workt.. any ideas?

#11 ShadowHawk

    Member

  • Members
  • PipPip
  • 47 posts

Posted 11 November 2004 - 10:58 AM

Gendramen said:

Yes.. i know that now.... but Up and Down (Down und Up).. Don;t Work that way..

i have trying:

	if (this.PicDude.Location.Y == 5)
         {
this.PicDude.Location =   new System.Drawing.Point(5, this.PicDude.Location.X );
          }

.. Walking in the good way? or lost? :huh:

View Post


Eh should it not be location.Y most systems work with X, Y . Might solve the problem dont copy code without checking it :closedeyes:

#12 Gendramen

    Member

  • Members
  • PipPip
  • 52 posts

Posted 11 November 2004 - 03:18 PM

Thanks for the Advice's
:blush:

Now i need some arry's doing the Cake stuff!...


Thanks for all the replys :lol:





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users