Jump to content

First attempt at c#

JamieF

I was messing around with c# for the first time today and I made this game where you can hit Linus in the head... sort of. It's like a hit the mole game but something to do with collision doesn't let you hit the object itself but rather touch the top left corner. I might fix it in the future :P

 

Basically you have 60 seconds to hit that corner as many times as you can. I've been working on this pretty much all day and I wanted to share it so I could get some feedback on what I could improve for the next rubbish game I make :P

 

post-41463-0-20689500-1395174311.png

 

It opens in full screen to give more playing room.

 

I can post the code if anybody wants to play about with it :)

 

Here's the link to download:

 

https://mega.co.nz/#!BwIGgbwY!M-_Onrv6ZfbJ2hLKcljg3BFeMnbVxnjwWX1tRKsVKnw

 

 

I apologise if this is the wrong place to put the topic or if it's not allowed at all.

Link to comment
Share on other sites

Link to post
Share on other sites

Haha nice work! And great picture of Linus  :P

This should be a tread where everybody can post their highscores.

Intel i7-870  //  MSI GTX 670 PE       ///       Intel i7-4500U  //  GT720M

Link to comment
Share on other sites

Link to post
Share on other sites

Man you made that in one at your first try at c# and I dont even know how to make a application outside of the console, and I have been learning c# in my freetime for a few weeks. 

 

 

Also can you link me to what you used to learn c#

Link to comment
Share on other sites

Link to post
Share on other sites

Can you upload the project/source somewhere?

 

I want to check it out. :P

Curing shitposts by shitposts

Link to comment
Share on other sites

Link to post
Share on other sites

Can you upload the project/source somewhere?

 

I want to check it out. :P

It's in the OP

 

How do I actually hit him? I didn't see it in the controls 

Link to comment
Share on other sites

Link to post
Share on other sites

Haha nice work! And great picture of Linus  :P

This should be a tread where everybody can post their highscores.

Thanks :)

 

 

Man you made that in one at your first try at c# and I dont even know how to make a application outside of the console, and I have been learning c# in my freetime for a few weeks. 

 

 

Also can you link me to what you used to learn c#

It was based off a tutorial I saw this morning. 

 

I made that game and then played around with the code. I tend to learn what I need for the project and pick up the basic stuff along the way :)

Link to comment
Share on other sites

Link to post
Share on other sites

Eww mega. Always gives me "Your browser seems a bit outdated". I don't want to downgrade to a new version of Opera damn it.

 

Your thing looks funky though :P I did a whack a troll last year for an assignment and it turned out quite well.

Try out XNA (unsupported now, but has a lot of useful functions) It's basically a nice pretty version of directX for c#

Aragorn (WS): 250D | 6800k | 840 Pro 512GB | Intel 530 480GB  | Asus X99-M WS | 64GB DDR4 | Corsair HX720i | GTX 1070 | Corsair H115i | Philips BDM4350UC 43" 3840x2160 IPS

Gimli (server):  Node 304 | G4560 | ADATA XPG SX8000 128GB | 2x 5TB WD Red | ASROCK H270M-ITX/AC  | 8GB DDR4 | Seasonic 400FL

 Omega (server):                 Fractal Arc Mini R2 | i3 4130 | 500GB Maxtor | 2TB WD Red : Raid 1 | 3TB Seagate Barracuda | 16GB RAM | Seasonic G-450w
Alpha (WS): 900D | 4770k | GTX 780  | 840 Pro 512GB  | GA-Z87X-OC | Corsair RM 850 | 24GB 2400mhz | Samsung S27B970D 2560x1440

                              ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||

Link to comment
Share on other sites

Link to post
Share on other sites

It's in the OP

 

How do I actually hit him? I didn't see it in the controls 

 

Where? I can only find the application executables...

Curing shitposts by shitposts

Link to comment
Share on other sites

Link to post
Share on other sites

Where? I can only find the application executables...

Oops... I didn't see that you said source. my bad

Link to comment
Share on other sites

Link to post
Share on other sites

Eww mega. Always gives me "Your browser seems a bit outdated". I don't want to downgrade to a new version of Opera damn it.

 

Your thing looks funky though :P I did a whack a troll last year for an assignment and it turned out quite well.

Try out XNA (unsupported now, but has a lot of useful functions) It's basically a nice pretty version of directX for c#

Thanks, i'll have a look :)

 

 

Where? I can only find the application executables...

I've included the whole project folder so you should be able to open it in vs :)

 

https://mega.co.nz/#!Ns5GEJwb!nMBk-orkkx0CIc3C3KJJW8__1do8rOcvHz0WCY2ILZM

Link to comment
Share on other sites

Link to post
Share on other sites

Thanks, i'll have a look :)

 

 

I've included the whole project folder so you should be able to open it in vs :)

 

https://mega.co.nz/#!Ns5GEJwb!nMBk-orkkx0CIc3C3KJJW8__1do8rOcvHz0WCY2ILZM

 

ImageToHit is created, but the constructor does accept size or anything, and you don't set the ImageSize after you created it, so you end up with ImageSize equally effectively 0...so the interesectswith only accepts the top left corner.

 

Consider something like

            public ImageToHit(Size size)            {                 ImageSize = size;                Speed.X=3;                Speed.Y=3;            }

OR less recommended, but still could work

        public Game()        {            Target.ImageSize = ///your size here            InitializeComponent();            SetStyle(ControlStyles.AllPaintingInWmPaint | ControlStyles.OptimizedDoubleBuffer | ControlStyles.ResizeRedraw, true);        }

0b10111010 10101101 11110000 00001101

Link to comment
Share on other sites

Link to post
Share on other sites

 

ImageToHit is created, but the constructor does accept size or anything, and you don't set the ImageSize after you created it, so you end up with ImageSize equally effectively 0...so the interesectswith only accepts the top left corner.

 

Consider something like

            public ImageToHit(Size size)            {                 ImageSize = size;                Speed.X=3;                Speed.Y=3;            }

OR less recommended, but still could work

        public Game()        {            Target.ImageSize = ///your size here            InitializeComponent();            SetStyle(ControlStyles.AllPaintingInWmPaint | ControlStyles.OptimizedDoubleBuffer | ControlStyles.ResizeRedraw, true);        }

Sorry i've been working on another project and forgot to say thank you :P

 

There was an error with the code (constructor takes in 0) but I fixed it by adding the height and width.

 

Link to comment
Share on other sites

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×