Someone help me in C#

Sort:
Avatar of BishopImtermediate

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace WindowsFormsApplication10
{
public partial class FlappyBird : Form
{
private int gravity;
private object flappyBird;

public FlappyBird()
{
InitializeComponent();
}

private void gameTimerEvent(object sender, EventArgs e)
{
NewMethod();}
private void NewMethod()
{
flappyBird.Top += gravity;
}

private void FlappyBird_Load(object sender, KeyEventArgs e)
{
int pipeSpeed = 8;
int gravity = 5;
int score = 0;
}

private void GameKeyIsUp(object sender, KeyEventArgs e)
{
if (e.KeyCode == Keys.Space) ;
{
gravity = 5;}}

private void GameKeyIsDown(object sender, KeyEventArgs e)
{
if (e.KeyCode == Keys.Space) ;
{
gravity = -5;
}
}
}
}

Avatar of Josh11live
Off topic pls
Avatar of ThuanBuiChessKC
BishopImtermediate đã viết:

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace WindowsFormsApplication10
{
public partial class FlappyBird : Form
{
private int gravity;
private object flappyBird;

public FlappyBird()
{
InitializeComponent();
}

private void gameTimerEvent(object sender, EventArgs e)
{
NewMethod();}
private void NewMethod()
{
flappyBird.Top += gravity;
}

private void FlappyBird_Load(object sender, KeyEventArgs e)
{
int pipeSpeed = 8;
int gravity = 5;
int score = 0;
}

private void GameKeyIsUp(object sender, KeyEventArgs e)
{
if (e.KeyCode == Keys.Space) ;
{
gravity = 5;}}

private void GameKeyIsDown(object sender, KeyEventArgs e)
{
if (e.KeyCode == Keys.Space) ;
{
gravity = -5;
}
}
}
}

gì v

Avatar of BishopImtermediate
Josh11live wrote:
Off topic pls

sorry, i forgot to put d=that

Avatar of BishopImtermediate
BDT-Chess_GM wrote:
BishopImtermediate đã viết:

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace WindowsFormsApplication10
{
public partial class FlappyBird : Form
{
private int gravity;
private object flappyBird;

public FlappyBird()
{
InitializeComponent();
}

private void gameTimerEvent(object sender, EventArgs e)
{
NewMethod();}
private void NewMethod()
{
flappyBird.Top += gravity;
}

private void FlappyBird_Load(object sender, KeyEventArgs e)
{
int pipeSpeed = 8;
int gravity = 5;
int score = 0;
}

private void GameKeyIsUp(object sender, KeyEventArgs e)
{
if (e.KeyCode == Keys.Space) ;
{
gravity = 5;}}

private void GameKeyIsDown(object sender, KeyEventArgs e)
{
if (e.KeyCode == Keys.Space) ;
{
gravity = -5;
}
}
}
}

gì v

C#

Avatar of PointlessR
I’m so confused. Are you trying to code flappy bird in windows forms?
Avatar of PointlessR
Also you called newmethod before defining it
Avatar of PointlessR
There is so much wrong with this. Does it work in VS?
Avatar of BishopImtermediate
PointlessR wrote:
I’m so confused. Are you trying to code flappy bird in windows forms?

Yup

Avatar of BishopImtermediate
PointlessR wrote:
There is so much wrong with this. Does it work in VS?

Yeah, i was try to can fix all, but i have Visual Studio 2015 Enterprise so i didn't know a lot like 2022