Small Windows Game

490e297b26cb4dba5e8479f63b93bb80
0
Gendramen 101 Oct 31, 2004 at 14:35

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.
form1..jpg
And dude (that thing) he is going left..
Uileg1.jpg

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

11 Replies

Please log in or register to post a reply.

7543b5c50738e23b200e69fe697ea85a
0
NomadRock 101 Oct 31, 2004 at 18:57

if(x < 0) x = X_MAX;

490e297b26cb4dba5e8479f63b93bb80
0
Gendramen 101 Nov 01, 2004 at 13:27

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

Wat means X_Max?

2b97deded6213469bcd87b65cce5d014
0
Mihail121 102 Nov 01, 2004 at 13:38

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

22b3033832c5c699c856814b0cf80cb1
0
bladder 101 Nov 01, 2004 at 14:05

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.

490e297b26cb4dba5e8479f63b93bb80
0
Gendramen 101 Nov 01, 2004 at 14:14

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

7543b5c50738e23b200e69fe697ea85a
0
NomadRock 101 Nov 01, 2004 at 18:08

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

490e297b26cb4dba5e8479f63b93bb80
0
Gendramen 101 Nov 03, 2004 at 13:54

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:

065f0635a4c94d685583c20132a4559d
0
Ed_Mack 101 Nov 03, 2004 at 15:46

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; ?

490e297b26cb4dba5e8479f63b93bb80
0
Gendramen 101 Nov 04, 2004 at 14:34

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?

51db081cc72925fda1695ce254187b20
0
ShadowHawk 101 Nov 11, 2004 at 10:58

@Gendramen

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:

[snapback]13621[/snapback]

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

490e297b26cb4dba5e8479f63b93bb80
0
Gendramen 101 Nov 11, 2004 at 15:18

Thanks for the Advice’s
:blush:

Now i need some arry’s doing the Cake stuff!…

Thanks for all the replys :lol: