Jump to content
  • Advertisement

locoflop

Member
  • Content Count

    20
  • Joined

  • Last visited

Community Reputation

135 Neutral

About locoflop

  • Rank
    Member

Personal Information

  • Interests
    Art
    Programming
  1. However all of the meaning of OOP is actually when is applied in a specific context, only when used within a design pattern. If your software entities form some sort of high level structures, you want to organize them in better terms and have the ability to control them dynamically.
  2. Essentially the classic way of programming is procedural just like C, you can consider a file (or a cluster of files linked together) as a module. This module might have a public API that exposes global variables and functions. Other functions that the programmer wishes to hide because they are very technical are marked as static so they are accessible only within the file of where they are declared. On the other hand in OOP imagine having such a module as described above, now call it a class, and have the ability to do lots sort of things with it. This is the so called flexibility / or portability. That instead of having your module stuck into place like a toolshelf in your warehouse, you would be able to have it like a toolbox and move it around and take it in different places with you.
  3. Hello, in this OpenTK application why can you get the perfect scale with Math.PI? http://www.opentk.com/node/2294   time = (time >= Math.PI) ? 0.0 : time + e.Time; variableScale = (float)(Math.Sin(time)); I know that Sin works best for 0..360 circle degrees range, but Math.PI related to time is strange.   If you have any references about and links to share please post here. Thanks.  
  4. locoflop

    Understanding Tiled TMX gids.

    Thanks a lot, this snippet helped me to clarify things a bit. Clever approach to iterate through all of the tilesets.
  5. locoflop

    xna dead. now what?

    Here is my favourites (random order): SharpDX: If you want DirectX support currently better for Windows PC, perhaps in the future also for tablets/mobile. There was an ongoing vote to convice Microsoft to enable some functionality that could allow developers to support mobile/tablet devices running Windows 8, but who knows what happened. OpenTK: Very good for cross platform (Windows/Mac/Linux), unfortunately support is halted so you must use the repo of Andy Korth at github in order to get the latest version. Also if you are interested in MonoTouch and MonoDroid chances are that you can reuse most of your code. Pencil.Gaming: An evolution of OpenTK, more clean and practial. It looks like a polished version of OpenTK that is tied to GLFW3 instead for Window management. Unity: You will have to use it to believe. For me personally, let me do other creative things in game rather than system development. It's a matter of where exactly is your interest.
  6. Have any one looked at the Tiled format?   One thing that I try to understand is if a layer contains tiles from two tilesets, then how you can understand which tile originates from a specific tileset.   For example: f tileset A consists of a region of numbers 1 to 19 then it will have first GID 1. If tileset B consists of a region of numbers 20 to 29 then it will have first GID 20. And so on...   If in a Layer I have these tiles: 1, 10, 2, 20, 15, 25 Then they match this pattern of tilesets: A, A, A, B, A, B   What I really don't understand is how you can estimate in programming how this happens. I have looked at various TMX parsers but I can't figure out how exactly they achieve that.
  7. Hello, I have a piece of code where I would like to move the player up and down with touch input. If the touch is made just above the player position then player moves up and the same goes for opposite direction. The problem I have is that when the position of player is the same as the touch position then I have a nasty filckering (player moves up for one moment then moves down, and keep going as long as I have the pressed event going on). I tried to eliminate the flickering but I can't figure out what is going on. Any ideas or a better preffered way will be much welcomed. public override void Update(GameTime gameTime) { #region Input NinjaGame.Instance.TouchCollection = TouchPanel.GetState(); foreach (TouchLocation tl in NinjaGame.Instance.TouchCollection) { if (tl.State == TouchLocationState.Pressed || tl.State == TouchLocationState.Moved) { float playerPosHalfHeight = this.Position.Y + (this.Texture.Height/2); // Something fishy is going on here... if (tl.Position.Y >= playerPosHalfHeight) this.Velocity = new Vector2(0f, 0.25f); if (tl.Position.Y < playerPosHalfHeight) this.Velocity = new Vector2(0f, -0.25f); } if (tl.State == TouchLocationState.Released) { this.Velocity = new Vector2(0f, 0f); } } #endregion base.Update(gameTime); /* In other words... float delta = (float)gameTime.ElapsedGameTime.Milliseconds; Position += new Vector2(Velocity.X * delta, Velocity.Y * delta); */ #region Screen bounds check (top / bottom) if (this.Position.Y + this.Texture.Height > NinjaGame.Instance.GraphicsDevice.Viewport.Height) this.Position = new Vector2(this.Position.X, NinjaGame.Instance.GraphicsDevice.Viewport.Height - this.Texture.Height); if (this.Position.Y < 0f) this.Position = new Vector2(this.Position.X, 0f); #endregion } Thanks, happy coding.
  8. locoflop

    [SlimDX] How to draw lines

    Thanks again man, I finally got some random lines with this code. using System; using System.Drawing; using System.Runtime.InteropServices; using System.Windows.Forms; using SlimDX; using SlimDX.Direct3D9; namespace SlimDXGUI { class Program { public struct LineVertex { public Vector3 Position { get; set; } public int Color { get; set; } } public class Form1 : Form { Direct3D d3d; Device device; LineVertex[] lineData; VertexBuffer vertexBuffer; System.Timers.Timer timer = new System.Timers.Timer(); Random rnd = new Random(DateTime.Now.Millisecond); protected override void OnLoad(EventArgs e) { d3d = new Direct3D(); PresentParameters pp = new PresentParameters(); pp.SwapEffect = SwapEffect.Discard; pp.DeviceWindowHandle = Handle; pp.Windowed = true; pp.BackBufferWidth = Width; pp.BackBufferHeight = Height; pp.BackBufferFormat = Format.A8R8G8B8; device = new Device(d3d, 0, DeviceType.Hardware, Handle, CreateFlags.HardwareVertexProcessing, pp); lineData = new LineVertex[100]; for (int i = 0; i < lineData.Length; i++) { lineData = new LineVertex(); lineData.Position = new Vector3(0f, 0f, 0f); Color c = Color.FromArgb( rnd.Next(1, 255), rnd.Next(1, 255), rnd.Next(1, 255)); lineData.Color = c.ToArgb(); } timer.Interval = 10; timer.Start(); timer.Elapsed += new System.Timers.ElapsedEventHandler(timer_Elapsed); } void timer_Elapsed(object sender, System.Timers.ElapsedEventArgs e) { Render(); } protected override void OnClosed(EventArgs e) { device.Dispose(); d3d.Dispose(); } public void Render() { device.Clear(ClearFlags.Target, Color.White.ToArgb(), 0f, 1); for (int i = 0; i < lineData.Length; i++) { float x = (float) (rnd.NextDouble() * 2) - 1; float y = (float) (rnd.NextDouble() * 2) - 1; lineData.Position = new Vector3(x, y, 0f); } device.BeginScene(); device.VertexFormat = VertexFormat.Position | VertexFormat.Diffuse; device.DrawUserPrimitives<LineVertex>(PrimitiveType.LineList, 0, lineData.Length / 2, lineData); device.EndScene(); device.Present(); } } [STAThread] public static void Main(string[] args) { using (Form1 form = new Form1()) { Application.Run(form); } } } }
  9. locoflop

    VBO: How to draw many points

    Sorry guys, I was confused with example number 6. The triangle uses shaders for movement. http://ogldev.atspace.org/www/tutorial06/tutorial06.html
  10. locoflop

    [SlimDX] How to draw lines

    Unfortunately I don't understand much, but if could write a tutorial then I would be very happy.
  11. locoflop

    VBO: How to draw many points

    No, I want OpenGL 3 with VBO and Shaders, I know how to do it with OpenGL 1.5 but OpenGL 3 is less popular in this moment of speaking (that's why I am asking).
  12. locoflop

    Tao Framework

    Yep, I agree with Fetze (as I see you quoted my statement ) OpenTK is the future.
  13. Hi there, in this tutorial I learnt to draw a single point. http://ogldev.atspace.org/www/tutorial02/tutorial02.html Also in later lessons I learnt how to give motion to vertices. What I would like to do is to know how can I create a rain effect? How to draw many points (raindrops)How to know the speed of each raindrop.How to know the bounds of lower and upper screen (inside the shader or outside in C++ code)?Any help will be much appreciated, thanks.
  14. I have started learning OpenGL 3.3 and 4.0 Very cool resources http://ogldev.atspace.org/ http://www.swiftless.com/opengltuts/opengl4tuts.html
  15. locoflop

    Collision Detection in C#

    Here's an example for tetris http://www.codeproject.com/KB/cs/moemeka4.aspx not essentially "easy" to understand, as they say in computer science) but it's practical.
  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!