- 0
Stuck on simple Visual Basic C# game
-
Recently Browsing 0 members
- No registered users viewing this page.
-
Similar Content
-
Unified Copilot experience will land in Visual Studio 17.10, due in May
By zikalify,
- microsoft
- visual studio
- (and 9 more)
- 3 replies
- 4 views
-
Microsoft introduces TypeScript 5.4: Explore the latest features and enhancements
By zikalify,
- microsoft
- typescript
- (and 4 more)
- 11 replies
- 2 views
-
Nvidia, Hugging Face and ServiceNow release StarCoder2 coding LLMs
By zikalify,
- nvidia
- hugging face
- (and 4 more)
- 2 replies
- 3 views
-
IT Skills: Top 10 Programming Languages for 2023 — Free report
By News Staff,
- ebook offer
- sponsored
- (and 2 more)
- 0 replies
- 2 views
-
Self-replicating worm malware infects exposed Redis data store used for live streaming
By Ishtiaqe Hanif,
- 1 reply
- 3 views
-
Question
pinacallada1
I am making a simple 5- a side text based football game for uni, problem is i suck at programming and have really messed it up so now im stuck as to what to do. The task description is only really to think of a simple 5 a-side game with goalkeeper (who can save), defenders (who can tackle) and attackers (who can shoot). All players have a Name, a position and can pass, dribble and run. This includes a hasball feature which will check if a particular player has the ball. So far i have a basic code i made to work off for my classes, i can think of what i need to do exactly but i just don't know how to express it in code.
So far i only need to build off classes for the interfaces below but i cant seem to get any arrays working with it, i don't know how to implement the shoot, tackle run actions, its my first time programming this semester and im still getting used to everything i don't want to fall behind or possibly fail because of one module. What i have to work off is follows:
interface IFootballPlayer
{
string Name { get; set; }
bool HasBall { get; set; }
int XPos { get; set; }
int YPos { get; set; }
void Pass(FootballPlayer receiver);
void Dribble(int x, int y);
void Run(int x, int y);
string ToString();
}
interface IGoalKeeper
{
int SaveSkill { get; set; }
void Save(Attacker attacker);
}
interface IDefender
{
int TackleSkill { get; set; }
void Tackle(Attacker attacker);
}
interface IAttacker
{
int ShootSkill { get; set; }
void Shoot(GoalKeeper goalKeeper);
}
If i can get this sorted ill be able to scrape a pass hopefully
I would be grateful for any advice, C# still looks like a alien language to me
Link to comment
Share on other sites
3 answers to this question
Recommended Posts