I got the original idea from: https://hackforums.net/showthread.php?tid=4146007
The idea was to make a square type game in C# that appears like Flappy Bird. I saw the preview of the game that the other developer made, which looked like this:
I figured out he was using pictureboxes, which isn't a very good way of doing it. Moving controls will always be slower and less efficient than using GDI to manually draw out the objects. He also used timers, which I'm not very fancy of. In my example, I handled the Form_Paint method, and I kept track of all the game objects in the instance of a class called Player.
Preview [v1.2]:
I've uploaded the source code to Github, check it out:
http://github.com/ThrDev/FlappyCS
Controls:
Code Jump: Space/Mouse Click
Pause: P
Quit: Q
Vouch for my boy Thr, this looks sick.
Looks like a very fun project tho! nice job :)
(Apr 2, 2014 09:24 AM)Snoweyes Wrote: Looks like a very fun project tho! nice job :)
Thanks (: Making it more realistic as I go. The latest push had a few fixes and added momentum to both jumping and falling, as well as more pipes and more heights, as well as more colors.
May I take your FPS counter thing to use it on my project ?
Thanks
Apr 2, 2014 10:24 PM
(This post was last modified: Apr 3, 2014 03:24 AM by Carlsson94.)
very intresting! good wrok I might take a look on it
I notiched something, if you press P to pause while the game is counting down to start the game the game will start.
DO NOT DEAL WITH THIS MEMBER
Isn't flappy bird getting old? Anyway, nice project!
(Apr 2, 2014 10:22 PM)EquiFox Wrote: May I take your FPS counter thing to use it on my project ?
Thanks
Sure. Just handle the Form_Paint event and make a integer and add one to it every time the form_Paont method executes, then every second read that value and then set it back to 0.
(Apr 2, 2014 10:24 PM)Carlsson94 Wrote: very intresting! good wrok I might take a look on it
I notiched something, if you press P to pause while the game is counting down to start the game the game will start.
Haha yes, I'll fix that in a new push today :P
(Apr 3, 2014 06:10 AM)derpin0n Wrote: Isn't flappy bird getting old? Anyway, nice project!
Unfortunately, it is. I just figured it would be fun to make something with GDI.
You should consider some better physic calculations.
(Apr 3, 2014 08:01 AM)beta69 Wrote: You should consider some better physic calculations.
If you're talking about the GIF, I have yet to update that with the newest update.
The physics look wonky, but it looks better than the original. Nice job :)
DO NOT DEAL WITH THIS MEMBER
Would you be able to change the stuff in this such as instead of a box you could put a different icon.
(Apr 3, 2014 11:10 AM)Ghost o_o Wrote: Would you be able to change the stuff in this such as instead of a box you could put a different icon.
well of course you could, but he's just doing
Code p.FillRectangle(new SolidBrush(Color.DarkCyan), Instance);
to draw the square.
put your image in then use p.DrawImage(yourbitmap, x, y);
instead of fillrectangle to replace it. prob want to get rid of the draw rectangle too.
Also OP, nice project, you going to continue on this or just a demonstration?
(Apr 3, 2014 11:26 AM)Dispersia Wrote: well of course you could, but he's just doing
Code p.FillRectangle(new SolidBrush(Color.DarkCyan), Instance);
to draw the square.
put your image in then use p.DrawImage(yourbitmap, x, y);
instead of fillrectangle to replace it. prob want to get rid of the draw rectangle too.
Also OP, nice project, you going to continue on this or just a demonstration?
I may continue on with it and eventually make it into a Windows 8 app.
This is very nice. I was going to code one, but you already did.
|