Jump to content
  • Advertisement

tmer1

Member
  • Content Count

    29
  • Joined

  • Last visited

Everything posted by tmer1

  1. 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; } }
  2. tmer1

    Unity basic Script question

    myInt = MultiplyByTwo(myInt); What is this line doing ?   and what is "return"  
  3. tmer1

    MouseState check if clicked

    ah ok that solves it. thanks.
  4. 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; }
  5. 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?
  6. 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(); } }
  7. ok so an object can have and manipulate a sub-object essentially right?
  8.   So is ContentManager a class within Object game ? im confused..
  9. tmer1

    laptop for programming

    Is there any specifications I should look for when buying a laptop for programming ?   like is bigger screen easier to work with because you see more code?
  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. 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...
  12. 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 ?
  13. 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
  14. 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 ?
  15. tmer1

    programming a 3D board

    yes sorry, 152 positions.   What are the advantages of using unity to program this vs otherwise?
  16. 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.
  17. How does using XNA differ from using Xamarin if you are programming in C# in both?   Is it the syntax of command lines that is different? i.e. order of writing commands   Is it possible to get a rough idea of this without knowing any programming,    I ask this because I have a Mac and most tutorials for beginners are in XNA, would it be possible to follow XNA tutorials and write in Xamarin ?
  18. tmer1

    C#: XNA and Xamarin

    so is .Net like a language translator that takes a program in one language and translates the entire program into a new language making the program ready to be published instantly?   To get MonoGame on my mac laptop what do I need to do? there are two options on the site:   MonoGame for VisualStudio MonoGame on GitHub   What do these mean?
  19. tmer1

    C#: XNA and Xamarin

    Thanks DvDmanDT,   I understand what a library of code is, but what does a ''framework'' for .NET mean?   What is .NET, (the wikipedia page is a little unclear for me)
  20. tmer1

    C#: XNA and Xamarin

    what does based on Xna mean?    Can I use MonoGame to write code on a mac?
  21. tmer1

    C#: XNA and Xamarin

    Whats MonoGames relation to Xna ?    More specifically I'd like to buy this book: http://www.barnesandnoble.com/w/beginning-c-programming-with-xna-game-studio-at-chamillard/1108649142?ean=2940014046589 Which is Xna based   and use my Xamarin to program the same application tutorial in the book.    Does this make sense? Where does MonoGame come into this?
  22. tmer1

    XNA vs Other

    Hi,   I am taking a short course in programming games in C#, about 70hrs class time. I have no previous knowledge of programming.    In class we will be using XNA, but I have a Macbook at home to work with. I know I cannot use XNA on the Mac, but will I be able to copy code from XNA and paste into another Mac friendly program ? Or am I better of borrowing an old windows laptop to work on homework ?     -also, if I intend to make simple 2D games for smartphone (on my macbook) should I be using Xamarin or Unity ? 
  23. tmer1

    XNA vs Other

    no I don't want to mess up my Macbook, its already 4 years old, and can act up occasionally.   I found an old PC laptop , real anteic it's from like 2007...  windows XP. I will use it for first few weeks and if I gain some confidence with messing around on Xamarin, i'll ask my teacher if I can just use my Mac and Xamarin in class.     Do you guys know any good tutorials for beginner programming using Xamarin ?
  24. tmer1

    XNA vs Other

    Ok thanks,   Don't care about grades, just wondering if using Mac at home would involve  2x  or more work.   Would it be possible to bring Mac to class and just work on that with a little pre knowledge of Xamarin tools ? after all both is using same language, C#..
  25. tmer1

    Learning Unity

    Hi there,   I come from a design background and I am keen on developing games for iOS. I get the impression that unity is a good tool for this.    So now I would like to learn some programming in (or is it considered with?) Unity. Could some one experienced please recommend me a place to start ? (payed or free resource)   Thanks,
  • 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!