|
Hello guys,
I want to build a small ping pong game in C# with 2 vertical bars on each side. How do I move the ball on X and Y axis once it hit by the player. How do i control the ball moment even it hits on the rectangle game box.
I am for your response for me to build this game thanks in advance.
|
|
|
|
|
|
Thanks of replying but i didn't find related to what i have asked.
|
|
|
|
|
|
I didn't mean that the site address you provide wasn't useful at all. All I wanted to say that there were so much information that i couldn't even track myself, am a (newbie). All I wanted to know how could i move Atari ping pong ball in the same way it is functioning on the link you now provided.
Thanks for helping me though.
|
|
|
|
|
Hi to All Champions,
Im using Visual Studio 2005 and .Net 3.0. I'm not able to execute Custom Attribute class.
Below is the code.
Code should work because MyAttribute is associate with SayHello(). Since it is associated , it should execute constructor of MyAttribute(). But its not working.
<br />
using System;<br />
[AttributeUsage(AttributeTargets.Method|AttributeTargets.Struct]<br />
public class MyAttribute:Attribute<br />
{<br />
private string regKey="abc";<br />
public MyAttribute(string regKey)<br />
{<br />
if(this.regKey==regKey)<br />
{<br />
Console.WriteLine("Permitted to use this App");<br />
}<br />
else<br />
{<br />
Console.WriteLine("Not registered to use this App");<br />
}<br />
}<br />
}
class useAttrib<br />
{<br />
[MyAttribute("hello")]<br />
public static string SayHello(string str)<br />
{<br />
return str;<br />
}<br />
static void Main()<br />
{<br />
Console.WriteLine(SayHello("Hello to Sufyan"));<br />
Console.ReadLine();<br />
}<br />
}<br />
Thanks,
sha
|
|
|
|
|
Putting an attribute on an item has no effect whatsoever, unless you write some code to do something with it. This means that you are going to have to use some reflection to get the method and then check to see if it has a custom attribute of your type attached to it.
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
I have editor sort of application developed in c# using .Net 3.0 framework. My editor works in two different modes i.e. in Enginnering mode & Standalone mode.
My requirements are
I should be able to run multiple instances of my application on same system in different modes. When I open the file in the editor then prior opening the file, it should check whether any instance of my application is running in particular mode or not. If the instance is running then file should use the running instance to open the file.
Considering above requirements, can some one give me ideas on following :
1) Out of all the running instances how I can select particular instance to operate upon?
2) How I can store my attributes i.e. mode of editor etc. in the running instance?
I hope, I'm clear with my question. If you want me to clarify more pls revert with your questions. I hope this forum will get me some directions.
Thanks
Krunal C
|
|
|
|
|
I am having trouble with 3 delete queries in my c# application(Win Mobile database)and MSVS 2005, two other Delete queries run fine. All the Delete queries run fine on Win XP, just not in Vista(Vista's User Account Control off). Here is the simple query
DELETE FROM [tableName] I get error SQL Execution error 3640. I get this error whether I am debugging in msvs2005, or running in the Query Designer or if I just run the application outside of msvs2005.
I can get a Delete Query to work if i use the key columns like
DELETE FROM Horse
WHERE (CODE = @p1) AND (Stable = @p2) AND (HorseName = @p3)
this one is not really useful to me though since I am trying to delete all rows no matter the value in these columns.
Hope someone has an idea.
If not is there any other way I can delete all rows from a data table?
I didn't quite understand how to use TRUNCAT TABLE in the Query Designer in MSVS 2005.
If anyone will accept the database tables to see if they get teh same error I will be happy to send them to you.
Thank you
Jon Stroh
|
|
|
|
|
Jon Stroh wrote: I get error SQL Execution error 3640
So did you look up that error number? What does it mean?
Also did you know there is a SQL / ADO.NET / ADO forum here on CodeProject?
|
|
|
|
|
I have tried to locate a list of error codes at msdn.com with no luck, they must be a secret LOL. I didn't know about the SQL/ado.net forum here. Should I re post this question there?
Thanks Jon Stroh
|
|
|
|
|
The Native Error code i 28574 which after I looked it up this is the entire expaination.
28574 An internal error occurred. P0:ID SSCE_M_INTERNALERROR
Doesn't help me much.
Thanks Jon Stroh
|
|
|
|
|
Can somebody tell me how can I programatically start a web service at a given hour, or at least point me in the right direction. I have a web service that has to start every day at a given time, but I don't know how to schedule a new start.The web service can be started once to configure the daily hour to start again. My idea is to use a second service that monitors the time of day and starts the main service at the desired moment, but I'm not sure that this is the best idea to use.
I am fighting against the Universe...
Reference-Rick Cook
|
|
|
|
|
Web services don't start. They are pieces of code that are called from other processes (because they are implemented as DLLs). In order to accomplish this, you are going to need to write an application that calls this service and schedule it using the job scheduler.
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
I wrote in my post that I have a solution for this issue and it seems that i wasn't far off. My mistake on the "start" word. Thank you for the reply.
I am fighting against the Universe...
Reference-Rick Cook
|
|
|
|
|
Wrap the webservice calls in an exe and use the Windows Scheduler to invoke the exe at the required time.
only two letters away from being an asset
|
|
|
|
|
Mark Nischalke wrote: Wrap the webservice calls in an exe and use the Windows Scheduler to invoke the exe at the required time.
????
|
|
|
|
|
What's confusing you?
only two letters away from being an asset
|
|
|
|
|
Scheduling a WebService
I suppose I don't know anything but that seems contradictory to anything remotely resembling "Best Practice". And wrapping it and using the windows scheduler just seems like more of the same.
|
|
|
|
|
Didn't say anything about scheduling a webservice.
Wrap the webservice calls in an exe and use the Windows Scheduler to invoke the exe at the required time.
How would you propose to do it?
only two letters away from being an asset
|
|
|
|
|
Mark Nischalke wrote: How would you propose to do it?
Well certainly this could be misleading but the OP states it's "his" WebService:
Albu Marius wrote: how can I programatically start a web service at a given hour
Albu Marius wrote: I have a web service that has to start every day at a given time
Therefore he should have the code for "what" it actually does and then it seems the appropriate thing to do would be to build a Windows Service using that code. A WebService does not seem to apply at all in this situation. Again this is all based on what could be completely misleading statements by the OP.
|
|
|
|
|
If this is something that doesn't really return any kind of values, why is it even written as a web service?? What does this thing do??
|
|
|
|
|
Sorry for the late answer. It is my service and it doesn't return any values but does have to send some emails to certain people containing data at a given time of night. It has to do these operations when the server is not too busy. Now I implemented a System.Timers.Timer so that I can start the processing methods at 1 o'clock in the morning. In this case the service timer runs all day and calls the methods that process and send data. If someone can give me a better idea please try.
I am fighting against the Universe...
Reference-Rick Cook
|
|
|
|
|
If you are running SQL Server, then I would suggest that you create a task that sends the emails and use the SQL Server agent to manage this for you.
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
Thanks for the advice but the task is far too complex for SQL Server because the emails have to be sent to a list of addresses that changes very often, the content of the emails is not the same and the scheduling for sending can be daily, monthly, yearly for each address. I decided to use timers and threads to accomplish this and also I have switched to a windows service instead of a web service.
I am fighting against the Universe...
Reference-Rick Cook
|
|
|
|