|
I've now released my first (within reason) game for the WP7. As Game Dev section looks a little empty thought I would show. Please forgive me if I burn your eyes, I'm no artist and I haven't even started my Uni course yet :p
Star Side
My next project is going to hopefully going to be a 3D Xbox 360 game
All comments (and criticism) widely accepted
|
|
|
|
|
This is not the place to advertise; this is a technical question and answer forum.
The best things in life are not things.
|
|
|
|
|
Ok if you want technical. In my next release I am building a real time ray-tracer. I'm currently having a problem making it fire the rays in a perspective fashion other than the orthographic fashion it is. It works fine apart from the orthographic look it has :/
Main Draw Sequence:
for (int X = 0; X < Width; X++)
{
for (int Y = 0; Y < Height; Y++)
{
Ray TRay = new Ray(new V3(X - HalfWidth, 0, Y - HalfHeight) - CameraLocation, new V3((X - HalfWidth) * 3f, 100, (Y - HalfHeight) * 3f) );
foreach (SceneModel TempModel in Models)
{
foreach (Triangle TempTriangle in TempModel.Triangles)
{
Intersection TInter = TempTriangle.Intersects(TRay);
if (TInter.Hits) Temp.SetPixel(X, Y, TInter.HitColour);
else Temp.SetPixel(X, Y, BackgroundColour);
}
}
}
}
Its self explanatory.
P.S. I was merely looking for opinions and possible improvements
|
|
|
|
|
Thomas.D Williams wrote: I was merely looking for opinions and possible improvements
I'm sure, but unfortunately that is not the purpose of these forums. If you want people to review and critique your work then write an article round it and post it to the Articles section. And don't forget to read the guidelines[^] first.
The best things in life are not things.
|
|
|
|
|
I have also developed a mobile App. Game.........
modified on Tuesday, September 6, 2011 7:59 AM
|
|
|
|
|
This may very well be one reason why nothing is going on here. I would post something far more often on my progress and to get some opinions if I had not to figure out some important question every time.
"Dark the dark side is. Very dark..." - Yoda
--- "Shut up, Yoda, and just make yourself another toast." - Obi Wan Kenobi
modified on Tuesday, August 30, 2011 7:37 AM
|
|
|
|
|
|
Hi - I know. Don't ask me why! It's all I can afford right now.
However, more to the point, I've a problem that is really weird. I'm trying to attach a movie using the following code:
//this code is associated with the button:
on(press){
_root.attachMovie("MyOldMovieClip", "MyNewMovieClip"+level, level);
_root["MyNewMovieClip"]+level._x = int(Math.random() * 500);
_root["MyNewMovieClip"]+level._y = int(Math.random() * 450);
level++;
}
I've got a movie clip symbol, and a button symbol in the library. The button only is on the stage.
//This code is associated with the stage:
level = 0;
stop();
Pressing the button produces nothing. However when I run a trace i.e.
trace(int(Math.random() * 500));
random values appear.
Please put me out of my misery.
|
|
|
|
|
Wow, it's been a while since I used flash, sometime around when ActionScript 3 came in I think. I can't remember anymore - it's just what I've read:
Example
myButton.onPress = function () {
trace ("onPress called");
};
Got it at Adobe, right here[^].
|
|
|
|
|
plese tell me that how can i protect a cd so that nobody can copy the information
|
|
|
|
|
A couple of things.
First, this is not the forum for asking a question like this. This is the Game Development forum.
Secondly, you will never be able to completely protect a CD so that nobody can access information on it. The closest you could get is to implement a DRM system that meant that it was difficult for others to copy the information; there will always be somebody determined enough to crack the DRM and access the information. If you could come up with a foolproof system, you'll end up being very, very rich.
|
|
|
|
|
You can't.
You could encrypt it and then charge for a key.
------------------------------------
I will never again mention that I was the poster of the One Millionth Lounge Post, nor that it was complete drivel. Dalek Dave
CCC Link[ ^]
Trolls[ ^]
|
|
|
|
|
Put the CD into a microwave, set the microwave to full power and then turn it on for a few seconds. Nobody will ever be able to read or copy anything from the CD.
If there is any way at all to read the data, then you can also copy it. There is no way to prevent this unless you completely destroy the CD. DRM and other protections also can't prevent that someone makes a copy. They only try to assure that the copy is worthless. Such protections can be removed, modified or tricked into allowing access to the CD, so they are also not foolproof.
"Dark the dark side is. Very dark..." - Yoda
--- "Shut up, Yoda, and just make yourself another toast." - Obi Wan Kenobi
|
|
|
|
|
Place it inside a safe that you can prevent unauthorized access to.
If the information is 'visible', it's take-able.
I've heard it said that the CIA have had devices for years that can reconstruct the contents of your PC screen simply by picking up the radiation emanating from the cable between it and your video card. They don't even have to see you or your pc visually.
Me fears you're asking the wrong kind of question entirely. You know why there aren't copies floating around the net of the software used to fly/control modern fighter planes? Simple, because access is restricted to those able to be trusted - not because there's any super-dooper copy protection scheme in place. It's a case of social engineering rather than the software kind.
|
|
|
|
|
maybe they have it now ... early with the crt´s it was much simpler: the radiation of the crt was readable ...
but the no such agency can even identify you by your typing rate/style.
I cannot remember: What did I before google?
|
|
|
|
|
The NSA Can identify you by your typing rate/style even before your fingers hit the keys.
|
|
|
|
|
NO, you can not......
I quit being afraid when my first venture failed and the sky didn't fall down.
~ Pravin ~
|
|
|
|
|
|
Now, let me change that or send me to the Hall of Shame as well
This here[^] is a little pet project of mine. Occasionally I have posted about it in the Lounge, but this looks like a better place to do that.
The screenshot is not from the actual game. It's just the test application for the 3D engine and the GUI. I'm still adding controls or features to the 3D engine until I have enough to start on the game client. And please don't say anything abozt the 3D models. I had to make them myself. It's getting better, but I'm no big artist.
At the moment I have hit an obstacle in the GUI. The layout can be loaded from XAML. This works well for serializable objects. The problem is, that the control's events are not serializable.
At the moment the events are plain CLR events, using delegates and event handlers, just like in windows forms. They are not serialized into XAML and therefore can't be loaded from XAML. What I need now is a good and practicable idea th wrap the functionality of events into serializable classes.
"I just exchanged opinions with my boss. I went in with mine and came out with his." - me, 2011
--- I am endeavoring, Madam, to construct a mnemonic memory circuit using stone knives and bearskins - Mr. Spock 1935 and me 2011
|
|
|
|
|
Why would you want to serialize events?
And what exactly do you mean by "events"? Do you mean you want to serialize the code that is called when the event occurs?
I have a few ideas, but I want to be sure I understand your problem fully first.
|
|
|
|
|
Perhaps I did not describe it well. We started out with ASP .Net pages, a browser game. That already worked well, but it was not really exciting. So we kept the code on the server side, but replaced the presentation part with a client.
WPF would have provided all the GUI we would ever need, but we also wanted to be able to render 3D scenes to make the whole thing a bit more interesting. Making WPF work together with a 3D engine is not easy. You run into very many issues and you can never safely assume that it really works on every computer.
So we ended up adding our own GUI to our XNA graphics engine. We carefully avoided all things which may not be available on the Windows Phone or the XBox, so the whole thing should also safely compile and run for those two. To be honest, we have not yet tested it, but at least in theory we are not limited to the PC.
For all practical reasons the GUI works very much like Windows Forms. You have a Form object and can programmatically add controls or set their properties. Naturally we don't have a designer in Visual Studio because the whole thing is do it yourself. But we can live very well with designing our forms with XAML instead. That is not really hard to do since .Net 4.0
This works very much like XML serialisation and we simply can take a complete form with all its child controls and serialize it to XAML. When the XAML is deserialized again, we get a completely initialized instance of the form with all child controls, properties or even data items as they were before. It's actually only two lines of code, no more.
You probably know how WinForm controls notify their parent forms of events, like buttons raising a OnClick event whenever the user clicks them. In the button's code the event would be declared like this:
public event EventHandler OnClick;
In the form you would find something like this:
Button.OnClick += new EventHandler(SomeMethodOfTheFormToHandleTheEvent);
Our GUI works exactly the same way. Plain ordinary delegates and event handler methods. The problem is, that the XAML does not contain anything about how the events of the controls and the event handlers are wired together. When we create a new instance of a form by loading the XAML, we get the complete form, but the information about which event handler method handles which control's events has been lost. Delegates and event handler methods are not serializable, so the only way to go is to replace them with something that is. It is possible, since WPF or Silverlight do just that.
Edit:
This is XAML for WPF:
<Button
OnClick="ButtonClickedHandler"
Name="MyButton"
Width="50"
Content="Click Me!" />
'OnClick' is treated like a normal string property of the button control class. It very probably really is just a string which contains the name of the form's event handler method. Ok, that's not hard to do. My first guess now is, that I must wire up the event after loading the form by finding the event handler method with reflection.
"I just exchanged opinions with my boss. I went in with mine and came out with his." - me, 2011
--- I am endeavoring, Madam, to construct a mnemonic memory circuit using stone knives and bearskins - Mr. Spock 1935 and me 2011
modified on Thursday, June 23, 2011 7:34 PM
|
|
|
|
|
CDP1802 wrote: My first guess now is, that I must wire up the event after loading the form by finding the event handler method with reflection.
Yep, that'd probably be the way I'd go.
As an alternative, you could give refer to the controls by their name. So, in your XAML you have this:
<Button
Name="MyButton"
Width="50"
Content="Click Me!" />
Then in your C# code, you have this:
this.MainControl = SomeXamlHelper.LoadMyXaml(Config.XamlForThisClass);
Part of that LoadMyXaml method would load up all the sub-controls by their Name . You could then refer to those controls by their name and wire up the handlers in the C#:
(this.MainControl.FindControl("MyButton") as AwesomeButton).OnClick += new EventHandler(SomeMethodOfTheFormToHandleThisEvent);
|
|
|
|
|
Thanks. It's almost 4 AM now and time to go to bed. But now I have a plan which I can sleep over.
Right now I again see two options:
The form does further initialisation and layouting when it is attached to the UI after loading. That involves going through the form and all its children. This is a good place to also wire up all events and probably best suited for your approach.
Or I might do it in a lazy fashion. When a control tries to raise an event and the wiring has not been done yet, then I may work my way back to the form, find the event handler method and wire it up on the fly.
One way or the other, this was really helpful. Thanks.
"I just exchanged opinions with my boss. I went in with mine and came out with his." - me, 2011
--- I am endeavoring, Madam, to construct a mnemonic memory circuit using stone knives and bearskins - Mr. Spock 1935 and me 2011
|
|
|
|
|
... here is the XAML that defines the left form in the screenshot. It is now included as embedded resource and loading and displaying the form works fine. I'm going to start working on the events now.
<cTestForm Id="FrmLayoutTest" Alpha="200" BackColor="0, 74, 127, 255" BorderColor="95, 158, 160, 255" CaptionColor="0, 54, 107, 255"
TextColor="255, 215, 0, 255" Text="UI Test" TextAlignment="MIDDLE_CENTER" BarWidth="32" CaptionPosition="RIGHT"
Font="Arial_16_bold" FontSize="16" FontStyle="BOLD" Width="375" Height="250" PositionX="600" PositionY="125"
xmlns="clr-namespace:PraetorTest;assembly=PraetorTest"
xmlns:foc="clr-namespace:FoC.Praetor4UI.Controls;assembly=Praetor4UI"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<cTestForm.Controls>
<foc:cPraePanel Id="PnlCaptionPosition" Width="115" Height="145" BorderColor="95, 158, 160, 255" PositionX="5" PositionY="5"
BackColor="0, 0, 0, 0">
<foc:cPraePanel.Controls>
<foc:cPraeLabel Id="LblCaptionposition" BorderColor="255, 255, 255, 255" Font="Arial_10" FontSize="10" FontStyle="NORMAL"
Width="105" Height="18" PositionX="5" PositionY="5" ResizeEnable="NONE" Text="Caption Position"
TextAlignment="MIDDLE_CENTER" TextColor="255, 215, 0, 255" />
<foc:cPraeImageButton Id="BtnUp" BackColor="173, 216, 230, 255" BorderColor="255, 255, 255, 255" Height="31"
HighlightColor="255, 255, 255, 255" Image="Button_up" PositionX="41" PositionY="35"
Width="31" />
<foc:cPraeImageButton Id="BtnLeft" BackColor="173, 216, 230, 255" BorderColor="255, 255, 255, 255" Height="31"
HighlightColor="255, 255, 255, 255" Image="Button_left" PositionX="5" PositionY="71"
Width="31" />
<foc:cPraeImageButton Id="BtnRight" BackColor="173, 216, 230, 255" BorderColor="255, 255, 255, 255" Height="31"
HighlightColor="255, 255, 255, 255" Image="Button_right" MaxHeight="0" PositionX="77"
PositionY="71" Width="31" />
<foc:cPraeImageButton Id="BtnDown" BackColor="173, 216, 230, 255" BorderColor="255, 255, 255, 255" Height="31"
HighlightColor="255, 255, 255, 255" Image="Button_down" PositionX="41" PositionY="107"
Width="31" />
</foc:cPraePanel.Controls>
</foc:cPraePanel>
...
Edit: I have shortened the XAML a little. And it's very hard to format properly. In the preview it looks ok, but when posted the lines still are too long. Sorry for that.
"I just exchanged opinions with my boss. I went in with mine and came out with his." - me, 2011
--- I am endeavoring, Madam, to construct a mnemonic memory circuit using stone knives and bearskins - Mr. Spock 1935 and me 2011
|
|
|
|
|
Can't be worse than the rubbish below!
------------------------------------
I will never again mention that I was the poster of the One Millionth Lounge Post, nor that it was complete drivel. Dalek Dave
CCC Link[ ^]
Trolls[ ^]
|
|
|
|
|