Jump to content

  • Log In with Google      Sign In   
  • Create Account

c# need help with libary


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
3 replies to this topic

#1 cyril98   Members   -  Reputation: 115

Like
0Likes
Like

Posted 28 November 2012 - 06:30 PM

hi guys i have been making a libary because i have been sick to death of using game maker
i need help with a few things

with the stealth in the game libary how do i make it so it goes up as you get closer to the enemy
is it like step MUL +1

i have been using ron pentons book to make the libary but instead of making the GSS3k im making a platform like rpg

and how do i make it so that when ever you pick a character the player becomes that character
do i make like a dummy class or use some sort of variable

and how do i utilize the functions on the keyboard
i tried to make a function called keypress

example

keypressEnter
keypressQ

and how on gods earth do i make a collision

like when a projectile collides with a oncoming foe
or when the player jumps off a building and hits the ground

and how do i make it so you can save the game by the click of a button

mind you im quite new to c#

if you want i can give you my code to look at to give you an idea of what im making

Sponsor:

#2 NoAdmiral   Members   -  Reputation: 614

Like
0Likes
Like

Posted 29 November 2012 - 01:21 AM

There's quite a bit you need to learn before you can get into doing most of what you outlined in your post. I would suggest picking up a book on C# (since it's what you're learning, and it's a perfectly fine language) and starting with the basics and work your way up to collisions and player-characters and stealth-systems.

I know there are a lot of good tutorials out there, try searching the forum to get an idea of which ones people have found useful.

Good luck!

Inspiration from my tea:

"Never wish life were easier. Wish that you were better" -Jim Rohn

 

herwrathmustbedragons.tumblr.com


#3 BCullis   Crossbones+   -  Reputation: 1813

Like
0Likes
Like

Posted 29 November 2012 - 08:36 AM

with the stealth in the game libary how do i make it so it goes up as you get closer to the enemy
is it like step MUL +1

That's not C# syntax, if you're trying to port over coding style from game maker.
You would need to write a function that compares player location to enemy location and calculates an arbitrary "detectable" score or percentage based on some algorithm you choose (i.e. negative linear relationship: as distance shrinks, detection grows; or exponential: large range of non-detection that rapidly increases as you get within 5 feet, etc)

and how do i make it so that when ever you pick a character the player becomes that character
do i make like a dummy class or use some sort of variable

Some sort of variable? Almost always.
It depends on how you're defining the "player". Often the player themself is an abstract data concept, and the "player" you see in the game is just a game asset assigned to the player's input and stats. You can swap 3d models or 2d sprites out all you want if the player class has a "model" or "sprite" variable.

and how do i utilize the functions on the keyboard
i tried to make a function called keypress

Just naming a function with the word keypress has no impact on how the compiler builds the code. You'll want to use an existing library that knows how to hook into the PC's messaging queue to intercept keyboard actions. SharpDX/SlimDX and SFML's c# wrapper all come to mind as making the keyboard available.

and how on gods earth do i make a collision

You write a physics library (not recommended) or you use an existing physics library. With where you're at, I'd honestly say just write a few simple physics-like constraints, for example ignoring a player's move command if they're trying to send their avatar through a wall. Either way you'll be busy writing some code.

and how do i make it so you can save the game by the click of a button

You write code for displaying the button, you write code that saves out whatever data you've deemed important to a "save game" file, and you call your save function inside some kind of onClick event the button owns.

Long story short: it sounds to me like you're used to an environment (game maker) where a lot of things are already written in low level code, and you're essentially scripting them contextually. C# is not a game library, it's not a framework, and it has no idea what a game, physics, keyboard, savegame, etc even ARE. It's a language that gets compiled into commands your PC understands. It's up to you to define all those things, or use a library/framework that does some of that definition for you. You made a BIG jump from game maker. NoAdmiral's point is very appropriate: if you're new to C#, you need to learn how to program in C# before tackling a game library.
Hazard Pay :: FPS/RTS in SharpDX
DeviantArt :: Because right-brain needs love too

#4 cyril98   Members   -  Reputation: 115

Like
0Likes
Like

Posted 09 December 2012 - 08:32 PM

im not that new to c# but anyway thanks for your help




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