Jump to content

  • Log In with Google      Sign In   
  • Create Account


need some pointers :D


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
7 replies to this topic

#1 cyril98   Members   -  Reputation: 115

Like
0Likes
Like

Posted 12 December 2012 - 06:33 PM

hi i need some pointers on how im coding please dont bash me because im sort of new to c#
and please for the love of god dont throw me off what im doing im new to c# but not new to programming

ive programmed in
c# been praticing it for two months
c++ done that for a while
visual basic
pascal
ada
ruby my very first language
python i hate the language

ones im going to learn soon
assembly
BASIC
sql
xml
advanced c#
more c++
powershell
unix unix isnt really a language its more a enviroment with commands

i have to go back and edit my code
but there are some crucial points that i need some guidance


1 story mode (i may need to edit it )

example
using my stuff

Vec.sprite( kyurem ) // do you need the file extension and the name
Vec.sprite( health bar full ) // vec sprite is a function i created based off the book the actual script for it isnt posted here
new = player();
new = darkknight();
string = "dark knight: you come so far but now its your end";
string = "cestus: you wish !!!!! go to the abyss";

// now this is where guidance is required
if darkknight health = 0;
{
string = "well done traning complete"
// now this i think might not be right
Vec.destroy kyurem();
new = grathpeak();
}


2 weapons

public class daegith_blade // i made this class public so the game can use this in like a shop
{
private int attack = 90;
private string skill1 = "corrosion blade"
Vec.sprite( daegith blade )
}

vec sprite and vec destroy are functions i made based off the book and have their own individual CS files

3 battle

this is only a section of the player script

keypressEnter
{
new = sword(); collis( enemy_instances )
}

Sponsor:

#2 uglybdavis   Members   -  Reputation: 810

Like
2Likes
Like

Posted 12 December 2012 - 08:46 PM

I'll give you a bad pointer: 0xFFFFFF
Take a minute to stop laughing.

Seriously tough, please be a bit more specific. Are you asking if the code you provided can be improved upon, design decision critique, general guidance? I'm not sure what it is you're looking for.

One bit of advice i can give is don't try to learn everything under the sun. Having a weak understanding of many languages has no value to it. Pick a language, and MASTER it. I would suggest C++, C#, LUA, Python in that order; they are the only languages i've had to use professionally. Python is more for tools than anything else.

Edited by uglybdavis, 12 December 2012 - 08:46 PM.


#3 Khatharr   Crossbones+   -  Reputation: 2619

Like
0Likes
Like

Posted 12 December 2012 - 09:21 PM

You need to do 2 things:
  • Study the C# syntax until you understand it fully.
  • Use source tags when you post code.

void hurrrrrrrr() {__asm sub [ebp+4],5;}

There are ten kinds of people in this world: those who understand binary and those who don't.

#4 archanian   Members   -  Reputation: 247

Like
2Likes
Like

Posted 12 December 2012 - 09:47 PM

A couple of pointers:

"new" is a keyword and is used for creating an instance of a class. You can't assign something to it.
I believe what you're looking for instead of this:
[source lang="csharp"]new = player();[/source]
is something like this:
[source lang="csharp"]Player somePlayer = new Player();[/source]

Additionallty, make sure you end each line with a semicolon.

This bit:
[source lang="csharp"]if darkknight health = 0;[/source]
needs a couple of adjusments. Firstly, you need to use dot syntax for accessing an object's properties. If health is a property of your darkknight object, you access it via "darkknight.health". Secondly, you need to put the if condition inside brackets. Thirdly, don't put a semicolon at the end (it won't break compilation, but the code block following your "if" will never run). What you want is something like this:
[source lang="csharp"]if (darkknight.health == 0)[/source]

This:
[source lang="csharp"]Vec.destroy kyurem();[/source]
From your description I gather that "destroy" is a method of Vec? In which case you need to call it as a method, with "kyurem" as a parameter like so:
[source lang="csharp"]Vec.destroy(kyurem);[/source]

Edited by archanian, 12 December 2012 - 09:51 PM.


#5 slicer4ever   Crossbones+   -  Reputation: 2606

Like
0Likes
Like

Posted 12 December 2012 - 11:07 PM

i don't exactly know what you are looking for, as uglybdavis said.
I'd like to ask you to be more concise about what it is your looking for,you've thrown a ton of random information at us, and for the most part we have no idea what they mean relative to you.

you mention book several times, but don't tell us what the book's name is, what parts you are having trouble with.
Check out https://www.facebook.com/LiquidGames for some great games made by me on the Playstation Mobile market.

#6 BCullis   Crossbones+   -  Reputation: 1800

Like
1Likes
Like

Posted 13 December 2012 - 07:27 AM

vec sprite and vec destroy are functions i made based off the book and have their own individual CS files


Seriously, what book are you referencing? If it's teaching you to code like this (and your last three threads), throw it away.

Two different methods of the same class shouldn't be in separate CS files, they should be in the .cs file that defines the class itself. (There are special cases where classes are broken up over different files, but that doesn't apply here)

ive programmed in
c# been praticing it for two months
c++ done that for a while
visual basic
pascal
ada
ruby my very first language
python i hate the language

ones im going to learn soon
...


Woah, stop. Just pick ONE language, actually learn it, and then pick up more when you've successfully created something substantial in the first language. You're all over the road, and not a single line of code you've shared since you started posting here will compile. It's obvious you're very excited and passionate about making something, but you're all hype and no focus. People have told you repeatedly to get back to basics: your syntax is way off. If you plan to stick with C#, learn C#. To say you've been practicing it for 2 months and then show us code like this tells me you either have a horrible teacher, or you're not learning anything from your practice.

Start simple, get small programs to compile and run, make sure they're doing what you expect them to, and then build from there. I'm not "bashing" you, I'm giving you direct, honest advice based on the quality of the code and information you're sharing with us.
Hazard Pay :: FPS/RTS in SharpDX
DeviantArt :: Because right-brain needs love too

#7 BCullis   Crossbones+   -  Reputation: 1800

Like
2Likes
Like

Posted 13 December 2012 - 07:34 AM

One bit of advice i can give is don't try to learn everything under the sun. Having a weak understanding of many languages has no value to it. Pick a language, and MASTER it. I would suggest C++, C#, LUA, Python in that order; they are the only languages i've had to use professionally. Python is more for tools than anything else.

No offense, but this is bad advice to give a beginner. It starts good, but after the third sentence I would have stopped.
Trim that list down to one. Don't give cyril a shopping list, they're having enough trouble with one language. And entire games are written in Python, if you tell someone "it's only good for _____" they might not even look into it, where many beginners here have done well learning with Python, and could make small games very quickly with it.
Hazard Pay :: FPS/RTS in SharpDX
DeviantArt :: Because right-brain needs love too

#8 kunos   Crossbones+   -  Reputation: 1776

Like
0Likes
Like

Posted 13 December 2012 - 07:35 AM

hi i need some pointers on how im coding please dont bash me because im sort of new to c#
and please for the love of god dont throw me off what im doing im new to c# but not new to programming

ive programmed in
c# been praticing it for two months
c++ done that for a while
visual basic
pascal
ada
ruby my very first language
python i hate the language


and then.. you decided to come up with your own programming language.. sounds legit to me Posted Image

obvious troll is obvious
Stefano Casillo
Lead Programmer
TWITTER: @KunosStefano
AssettoCorsa - netKar PRO - Kunos Simulazioni




Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS