Jump to content
  • Advertisement


  • Content Count

  • Joined

  • Last visited

Community Reputation

169 Neutral

About tmer1

  • Rank
  1. tmer1

    Unity basic Script question

    myInt = MultiplyByTwo(myInt); What is this line doing ?   and what is "return"  
  2. The code below works and displays a value of 10 in the console. My question is how does this work, because we never gave the int "number" a value? using UnityEngine; using System.Collections; public class VariablesAndFunctions : MonoBehaviour { int myInt = 5; void Start () { myInt = MultiplyByTwo(myInt); Debug.Log (myInt); } int MultiplyByTwo (int number) { int ret; ret = number * 2; return ret; } }
  3. tmer1

    MouseState check if clicked

    ah ok that solves it. thanks.
  4. tmer1

    MouseState check if clicked

    ok thanks but the book specifically said:   "...If the player has clicked (meaning pressing and then releasing the mouse button)"   the previous code has nothing to do with releasing afterwards it just checks for state released, then next state pressed.  This is not the usual definition of click is it?
  5. In chapter 6 of my C# book we learn how to program an If check for a mouse click. It says that to do this we need:   1. The player did not press the mouse button during the last Update method; 2. In the current Update method, the player presses the mouse button.   But this says nothing about releasing the mouse button ?? I ran the program and it only takes into account pressing, not releasing... Whats going on? protected override void Update(GameTime gameTime) { previousMouseState = currentMouseState; currentMouseState = Mouse.GetState(); if (currentMouseState.LeftButton == ButtonState.Pressed && previousMouseState.LeftButton == ButtonState.Released) calculateAngle = !calculateAngle; if (calculateAngle) { double opposite = currentMouseState.Y - barrelPosition.Y; double adjacent = currentMouseState.X - barrelPosition.X; angle = (float)Math.Atan2(opposite, adjacent); } else angle = 0.0f; }
  6. ok so an object can have and manipulate a sub-object essentially right?
  7.   So is ContentManager a class within Object game ? im confused..
  8. Hi,   I am attempting to teach myself C# Game Basics from book (Learning C# by Programming Games) In Chapter 5 we are introduced to a simple Game where the cursor is replaced by a picture of a balloon. This is about where Objects, Classes, Methods and Properties are explained. I am now looking at the code for this game and I am confused about a few things I was hoping someone could help me understand. So here is the code: (my question is inside //    // )   using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Microsoft.Xna.Framework.Input;   class Balloon : Game {   GraphicsDeviceManager graphics; SpriteBatch spriteBatch; Texture2D balloon, background; Vector2 balloonPosition;   static void Main() { Balloon game = new Balloon(); game.Run(); }   public Balloon() { Content.RootDirectory = "Content"; graphics = new GraphicsDeviceManager(this); }   //  1. Content is a property of Game which is essentially a location on the pc ? Then RootDirectory is a Method that specifies where all the assets are located? so Content.RootDirectory gives the property content a location. Why can't you just write Content = "Content"    2. GraphicsDeviceManager is a class with a parameter the object we created called game ? we have created a new object in this line: graphics ?   3. what is difference between a parameter and a property of an object ? //   protected override void LoadContent() { spriteBatch = new SpriteBatch(GraphicsDevice); balloon = Content.Load<Texture2D>("spr_lives"); background = Content.Load<Texture2D>("spr_background"); }   protected override void Update(GameTime gameTime) { MouseState currentMouseState = Mouse.GetState(); balloonPosition = new Vector2(currentMouseState.X, currentMouseState.Y); }   protected override void Draw(GameTime gameTime) { GraphicsDevice.Clear(Color.White); spriteBatch.Begin(); spriteBatch.Draw(background, Vector2.Zero, Color.White); spriteBatch.Draw(balloon, balloonPosition, Color.White); spriteBatch.End(); } }
  9. ThinkPad is way above budget. But its great that they discarded the useless numeric section. Is there a point to the Numerics?   I want a laptop for portability so I can study at library with friends, etc...
  10. Hi,   Iv'e got 600-1000 $AUD to spend on a new laptop It needs to be able to program simple games, some using Unity 3D but all are compact and not graphically intense.   1. I want to go 15" screen size, what other specifications should I look for ?   2. I notice that almost all latest 15" laptops have a numeric keypad, I think this is a great waste of keyboard space, who manufactures laptops without Numerics?
  11. tmer1

    laptop for programming

    OK Im reviveing this,   Im prepared to spend between $600-$1000 AUD. I want to be able to program Simple games but they may relay on unity 3D.   Cubistry, Soccer Stars, 868-Hack, Threes, Ridiculous Fishing are good example of the level of complexity I am aiming for.   What about this laptop: https://www.jbhifi.com.au/computers-tablets/laptops/dell/dell-inspiron-3000-x510404au-15-notebook/546917/   What do you guys recommend ?
  12. tmer1

    programming a 3D board

    Thanks for replies,   I have a lot to learn and when I get my first programming book and work through it i'll understand what you guys mean better.   Thanks Frob for brining my attention to Cubistry, it is not what my game design is like though.    It looks like a pretty good reinterpratation of the classic match tiles game. I wonder was candy crush the first, or is it just the most popular?    Is Cubistry a unity game?   Edit: Yes it is.   Can you estimate how much extra code would programming such a 3D rotating board take ?
  13. tmer1

    programming a 3D board

    yes sorry, 152 positions.   What are the advantages of using unity to program this vs otherwise?
  14. tmer1

    laptop for programming

    ugh... I think i'll just stick to my mid 2010 Mac...   Problem is that book I plan on learning from: https://wordery.com/learning-c-by-programming-games-arjan-egges-9783642365799   is based in windows applications. Xna or MonoGame ?   Do you think I will be able to translate instructions into Xamarin ? I'll give it a go i guess. If it is too hard I'll get a Windows laptop. Worth a go and I love my Mac.
  15. How difficult is it to program a 3D board with pieces that move through the tiles and the user is able to rotate the board in any direction to look at and control the pieces movement.   Would this be a job for unity ?   I've attached an example picture. Basically a bevelled cube with 136 tiles.   edit: 152 tiles
  • 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!