Chez 01
Badges: 13
Rep:
?
#1
Report Thread starter 6 months ago
#1
i am coding for my a level project and i am a bit stuck on some code writing, could someone who knows how to code in c# and is mayb familiar with monogame please help?
0
reply
winterscoming
Badges: 19
Rep:
?
#2
Report 6 months ago
#2
I haven't seen monogame before, but it looks like a cross-platform version of Microsoft XNA's framework, (has been designed to work in exactly the same way as XNA), but it would help if you could describe what you're stuck on? Are you having trouble with the monogame framework or is it something about the C# language?

If it's about monogame, did you start by following any of the tutorials on their site? If the whole framework is new to you then it'd be a very good idea to go through all of those first so that you can try to understand what its capabilities are and how to use it before starting on your real project.

Since it's based on XNA, you might find some of the Microsoft XNA tutorials and reference docs useful too (if those haven't been ported to the monogame site anyway), and questions on StackOverflow which are tagged with XNA should be relevant too.
Last edited by winterscoming; 6 months ago
0
reply
Chez 01
Badges: 13
Rep:
?
#3
Report Thread starter 6 months ago
#3
(Original post by winterscoming)
I haven't seen monogame before, but it looks like a cross-platform version of Microsoft XNA's framework, (has been designed to work in exactly the same way as XNA), but it would help if you could describe what you're stuck on? Are you having trouble with the monogame framework or is it something about the C# language?

If it's about monogame, did you start by following any of the tutorials on their site? If the whole framework is new to you then it'd be a very good idea to go through all of those first so that you can try to understand what its capabilities are and how to use it before starting on your real project.

Since it's based on XNA, you might find some of the Microsoft XNA tutorials and reference docs useful too (if those haven't been ported to the monogame site anyway), and questions on StackOverflow which are tagged with XNA should be relevant too.
ive already started the real project, i have tried looking through them sites,
so im making a typing game and the player has to type the words that are displayed on the screen. im my code i have a list of words that will appear on the screen, currently only one word reappears on the screen, but i want it to be a different word each time
0
reply
winterscoming
Badges: 19
Rep:
?
#4
Report 6 months ago
#4
(Original post by Chez 01)
ive already started the real project, i have tried looking through them sites,
so im making a typing game and the player has to type the words that are displayed on the screen. im my code i have a list of words that will appear on the screen, currently only one word reappears on the screen, but i want it to be a different word each time
Ah ok, If you're making a text-based game then actually you're probably not actually going to be using half of the stuff that monogame gives you. Most of it relates to things like art, graphics, animation, geometry, sound effects, music, etc.

Have you got a list of words in your code somewhere? You could try using something like this to choose a random word from a list: https://stackoverflow.com/questions/...m-item-in-list
0
reply
Chez 01
Badges: 13
Rep:
?
#5
Report Thread starter 6 months ago
#5
(Original post by winterscoming)
Ah ok, If you're making a text-based game then actually you're probably not actually going to be using half of the stuff that monogame gives you. Most of it relates to things like art, graphics, animation, geometry, sound effects, music, etc.

Have you got a list of words in your code somewhere? You could try using something like this to choose a random word from a list: https://stackoverflow.com/questions/...m-item-in-list
it is a shooting game but the player shoots the enemy by typing the word, yes i do have a list of words in my code, sorry i didnt explain properly
my code does randomly pick a word, but each time another word gets displayed it picks the same word instead of picking a new one
0
reply
winterscoming
Badges: 19
Rep:
?
#6
Report 6 months ago
#6
(Original post by Chez 01)
it is a shooting game but the player shoots the enemy by typing the word, yes i do have a list of words in my code, sorry i didnt explain properly
my code does randomly pick a word, but each time another word gets displayed it picks the same word instead of picking a new one
Without knowing what the code looks like there's no way to know what's wrong, but the way to troubleshoot it would be to put a few Debugger breakpoints in your code to see what's actually happening by letting visual studio step through the code line-by-line and using that to inspect your variables along the way.

You should take 15-20 minutes to read through these and learn to use the debugger, because that'll help you figure out what your code is really doing and help you solve this problem and any other errors you run into like this if your app isn't doing what you expect:
https://docs.microsoft.com/en-gb/vis...s?view=vs-2017
https://docs.microsoft.com/en-gb/vis...n&view=vs-2017
https://docs.microsoft.com/en-us/vis...r?view=vs-2017

Make sure you run your app in the debugger (default hotkey in Visual studio is F5. Don't use CTRL+F5 because that will run it without the debugger) and set some breakpoints around the relevant bits of the code - for example:
The bit of code which creates a random number
The bit which chooses a word
The bit of code which updates the screen
Last edited by winterscoming; 6 months ago
0
reply
Chez 01
Badges: 13
Rep:
?
#7
Report Thread starter 6 months ago
#7
(Original post by winterscoming)
Without knowing what the code looks like there's no way to know what's wrong, but the way to troubleshoot it would be to put a few Debugger breakpoints in your code to see what's actually happening by letting visual studio step through the code line-by-line and using that to inspect your variables along the way.

You should take 15-20 minutes to read through these and learn to use the debugger, because that'll help you figure out what your code is really doing and help you solve this problem and any other errors you run into like this if your app isn't doing what you expect:
https://docs.microsoft.com/en-gb/vis...s?view=vs-2017
https://docs.microsoft.com/en-gb/vis...n&view=vs-2017
https://docs.microsoft.com/en-us/vis...r?view=vs-2017

Make sure you run your app in the debugger (default hotkey in Visual studio is F5. Don't use CTRL+F5 because that will run it without the debugger) and set some breakpoints around the relevant bits of the code - for example:
The bit of code which creates a random number
The bit which chooses a word
The bit of code which updates the screen
If i private messaged abit of my code would you be able to help me from there
0
reply
winterscoming
Badges: 19
Rep:
?
#8
Report 6 months ago
#8
(Original post by Chez 01)
If i private messaged abit of my code would you be able to help me from there
If you know exactly which bit or bits of code have got the problem then I can take a look - did you set any breakpoints in Visual Studio around the various bits of code which control your random word choice to find out which part of the code is causing the problem? Otherwise you might just end up finding that the real problem is in a completely different part of the program than the place you're looking in; that's what the debugger helps with.

All you need to do is click along the left-hand side of the code editor in visual studio to put 'Red Dots' on the lines that you want to inspect, then press F5 and watch the program run. (Then after the program pauses when it hits the line, you can mouse-over the variables to see their content, then either use F10 and F11 to "step" or F5 to unpause)
0
reply
X

Quick Reply

Attached files
Write a reply...
Reply
new posts
Back
to top
Latest
My Feed

See more of what you like on
The Student Room

You can personalise what you see on TSR. Tell us a little about yourself to get started.

Personalise

University open days

  • Cardiff Metropolitan University
    Undergraduate Open Day - Llandaff Campus Undergraduate
    Sat, 19 Oct '19
  • Coventry University
    Undergraduate Open Day Undergraduate
    Sat, 19 Oct '19
  • University of Birmingham
    Undergraduate Open Day Undergraduate
    Sat, 19 Oct '19

Why wouldn't you turn to teachers if you were being bullied?

They might tell my parents (26)
7.07%
They might tell the bully (35)
9.51%
I don't think they'd understand (56)
15.22%
It might lead to more bullying (143)
38.86%
There's nothing they could do (108)
29.35%

Watched Threads

View All