Jump to content
  • Advertisement

coolblue3000

Member
  • Content Count

    15
  • Joined

  • Last visited

Community Reputation

121 Neutral

About coolblue3000

  • Rank
    Member

Personal Information

  • Interests
    Programming
  1. Personally I would not use JavaScript to learn game programming. I use JavaScript a lot in my day job (Web Developer) and although it has some good points as a scripting language for controlling web pages, I do not like it as a language. There are many other better languages to use for a first project. C# is excellent, Python is great and even Lua is better than JavaScript. Unity uses C# and makes it reasonably simple to get things up and running quickly. There are loads of tutorials on Python games out there and there is the PyGame framework to get you going quickly. The other good tool is Pico-8. It is a fantasy console (basically an emulator) that restricts it to 8-bit (think the old NES and Master System consoles). It costs $15 but for that you get the entire development kit with audio creator and graphics creator etc. It is programmed in Lua and some great games originated on it including the amazing Celeste! However I agree with @Rutin above in that it is best to use whatever you are most comfortable with. Also I have no idea who told you C++ and Direct X were the best way to learn game programming... That could not be further from the truth!
  2. coolblue3000

    Pacman style collision detection Unity 5

    I have tried to turn physics off by checking iskinematic. However if I do this then OnCollisionEnter2D is never called..... I have also reduced the size of the BoxCollider2D to 59x59 but it still collides with the walls despite physically being able to see the gap!
  3. coolblue3000

    Pacman style collision detection Unity 5

    To be fair Treacle is probably more widely know around the world than molasses and technically they are slightly different products. However they are both thick and sticky so they could be used interchangeably in my example ;-)
  4. coolblue3000

    Pacman style collision detection Unity 5

    Thanks for that. I thought that was the solution but just wanted to make sure. I will take a good look at the pacman dossier. I have a feeling that my wall collision issue is Down to unitys scaling. As I am testing it in the player which is much smaller that the intended resolution. However I am not sure why that would lead to the treacle effect...
  5. I have a game that works in a similar way to pacman (ie is a tight maze). I have 2 issues. 1: I have a player object which is around 50 pixels square and I have added a boxcollider2d to it that is 60 pixels square. I am trying to move this player down the corridor which is 60 pixels wide but if I press against the wall it seems to get partially stuck and moves as if it is in treacle until it is clear of that particular wall tile. It also seems to get completely blocked occasionally by wall tiles. If I make the boxcollider2d 58 pixels square then my player moves fine even after being pressed up against a wall tile. However this also means there is some sideways movement in the corridor by 2 pixels as the object is no longer exactly the same width as the path. 2. If I am moving say to the right and there is a path leading down, I have to be pixel perfect in my alignment in order to change direction. Pacman never has this issue. Do I need to have a sweet zone where it automatically aligns my character with the path or is there a better way?
  6. I am using InControl to handle inputs in my game but I am having a very annoying issue. I have added the InControl component to an initial splash screen in order to initialise the controllers. This then goes to a menu screen which is using Unity UI. I have replaced the standard event input and touch event input components with the InControl input component buy I now get an error saying "multiple eventsystems in scene". How do I get InControl and Unity UI to play nice? This must after all be possible......
  7. I have a Unity UI Button on my canvas and I have set the "First Selected" option on the buttons EventSystem component.   When i run the scene in the editor I can simply press space or button0 on an xbox one pad and the Button is activated. However when I run it on my Nexus Player and press button0 on the gamepad the button is not activated.   Does anyone know what might be going on?
  8. coolblue3000

    Pros and Cons Unity for Android

    Just to point out that unity is a game engine with ide functions but android studio is simply an ide.
  9. coolblue3000

    splash and menu screens

    Thank you that looks really helpful.
  10. This may be a broad question but I am not sure how else to ask it. I have a some game in which I can move 2d box around the screen. However I am have no idea how to implement menus and splash screels etc. Has anyone got any advice or can point me at a good article which will explain how I program the system to display menus at the correct time and splash screens (for instance before each level starts) from within the open gl game loop. Do I hard code it or load the paths from Xml etc? This is stumping me and no tutorials i have come across explain this side of game programing.....
  11. coolblue3000

    Am I misunderstanding gl.glTranslatef?

      This is though exactly how it does work.   The matrix is just temporary data you set up for opengl, and you should recreate it each draw call.  For each object you want to draw, you should do glPushMatrix, then any glTranslate, rotate, etc, before the draw-call then after call a glPopMatrix to reset it.   The actual position of your object is stored in _position.x and _position.y in your code.   You should update the _position elsewhere in your code, if you want your object to move.   Usually you do this in a separate function before calling the function that draws your scene.   Ok, thanks, that makes more sense now.
  12. coolblue3000

    Am I misunderstanding gl.glTranslatef?

    To put this another way,    If I put the line gl.glTranslatef(2.0f,2.0f,0.0f); I would expect the matrix to be moved diagonally by 2 units each frame. However my matrix stays static at position 2,2   If I increment the values each frame (2,4,6 etc) then my matrix moves diagonally. However I did not think this was how glTranslatef worked?
  13. coolblue3000

    Am I misunderstanding gl.glTranslatef?

    My mistake, I was putting popmatrix in the wrong place...   However this still results in no change to my original question.
  14. coolblue3000

    Am I misunderstanding gl.glTranslatef?

    I am setting up the view as follows   gl.glViewport(0,0,width,height);  //Reset the current viewport         gl.glMatrixMode(GL10.GL_PROJECTION); //select the projection matrix         gl.glLoadIdentity();            //Reset the Projection Matrix           gl.glOrthof(0f,1920f,1080f,0f,-1f,1f);   I have also tried putting a gl.glPopMatrix after the translatef call but this then causes my objects to remain static......
  15. I was under the impression that gl.glTranslatef() effectively moved a sprite by the values passed in to the method (ie if I wanted a sprite to move by 2 pixels I would call gl.glTranslate(2.0f,0.0f,0.0f);   However If I do this then the sprite remains static. However If I pass in an absolute position (ie call gl.glTranslatef(52.0f,0.0f,0.0f)) my sprite moves as expected. However its starting position is out by the initial position coordinates (ie If I specify the sprite to start at 30,30 then the first draw loop draws the sprite at 62,30, once the first frame is done the sprite moves as I expect.   What is going on?   here is the draw code for my sprite.               //Reset the modelview matrix             gl.glLoadIdentity();               //drawing                 //bind the previously generated texture             gl.glBindTexture(GL10.GL_TEXTURE_2D,this._texture);               //point to our buffers             gl.glEnableClientState(GL10.GL_VERTEX_ARRAY);             gl.glEnableClientState(GL10.GL_TEXTURE_COORD_ARRAY);               //set the face rotation             gl.glFrontFace(GL10.GL_CW);               gl.glPushMatrix();             gl.glTranslatef(_position.x,_position.y,0.0f);//need to work out fraction of 1 that the position of the sprite represents               //point to our vertex buffer             gl.glVertexPointer(3, GL10.GL_FLOAT, 0, _vertexBuffer);               gl.glTexCoordPointer(2, GL10.GL_FLOAT, 0, _textureBuffer);                 //draw the vertices as a triangle strip             gl.glDrawArrays(GL10.GL_TRIANGLE_STRIP, 0, _vertices.length / 3);             //gl.glPopMatrix();             //disable the client state before leaving             gl.glDisableClientState(GL10.GL_VERTEX_ARRAY);             gl.glDisableClientState(GL10.GL_TEXTURE_COORD_ARRAY);     Note that this passes in the absolute position and not the small extra movement.
  • 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!