One of the core fundamentals of programming. Here’s an example: public void randomX(GameObject obj){         GameObject wall = GameObject.Find (“wallLeft”);         Vector2 fullScreen = Camera.main.ScreenToWorldPoint(new Vector2(Screen.width,Screen.height));         //world point calculations         float wallWidth = wall.GetComponent<Renderer> ().bounds.size.x;         float objWidth = obj.GetComponent<Renderer> ().bounds.size.x;         float widthRange = fullScreen.x – wallWidth-objWidth/2;         float ranX = Random.Range (-widthRange, widthRange);         obj.transform.position = new Vector2 (ranX, obj.transform.position.y);     } This function gives a game object a random x position on the screen. It takes into consideration padding on the … Continue reading

So in Demonfall I wanted the guy to fall, hit the platform, jump back up to the top and then fall again. I wanted the same height jump each time. This doesn’t work by default when you turn the global … Continue reading

  So, we got the left and right GUI Repeat Buttons buttons working now (the dark blue buttons with the <- and -> text in them. They’re actually more of a semi-transparent grey but they’re on top the 2 blue … Continue reading

For example in one script we store the number for the score as well as the function to update the score on screen. In this example it’s called gameCode.cs and it would go something like this: public int score = 0; public void updateScore(){         GameObject labelScore = GameObject.Find (“labelScore”);         … Continue reading

I was trying to update a html file I uploaded and got the error: File type does not meet security guidelines. Try another. Very annoying. Luckily googling led me to the solution fairly easily. In the functions.php file in your … Continue reading

After Unity to Windows 8 Checklist and Unity to iOS Checklist, this is the Andriod version: To test on Andriod devices you will need to download the ‘Andriod SDK’ which also requires “Java SE Development Kit”. you need to download … Continue reading

To add gravity to your main hero (for example) so he falls to physics: Place the image of the character into the scene and in the inspector click ‘add component’ and select ‘box collider 2d’ or circle collider 2d’ depending … Continue reading

Going to try recording my progress each week mainly as a motivator to get things done. Here’s week one: So we have the guy character. He’s affected by the global gravity and is constantly falling. When he hits the platform … Continue reading

Side Ads

Featured

This little demo puts promotional ads on the left and right of the webpage. To do this, the HTML is structure is like this: <body> <div id=”mainContainer”>     Main Website Content. </div> <div class=”adContainer”>     <div class=”leftAd”><a href=”http://www.google.com” target=”_blank”>left ad … Continue reading

Below is a link to a HTML file that has some CSS and code for starting a mobile friendly email. Here are also some tips: Don’t use margins: Outlook doesn’t like it Padding: give the containing table a width but … Continue reading