Programming A Game With Unity: A Beginner's Guide: PC & Mobile Lifestyle Hardware Deals Giveaways Top Lists About Chats
Programming A Game With Unity: A Beginner's Guide: PC & Mobile Lifestyle Hardware Deals Giveaways Top Lists About Chats
Lifestyle
Hardware
Deals
Giveaways
Top Lists
About
Chats
Search
Programming
Table Of Contents
1Introduction
2Versions of Unity
3Installing Unity
4A Brief Introduction to the Object-Oriented Paradigm
5Unity Basics
6Example: Basic Elements of a Game
Ads by Google
7Scripting in Unity
8Example: Scripting Pong
9Exploring the Documentation / Learning More
10Building Your Game / Compiling to a Standalone Application
11??Closing Notes
1. Introduction
A surprising feature of the Internet economy is the rise of indie videogames. Once the exclusive domain of
thousand-man, multi-million dollar triple-A studios, a number of toolsets have been developed that bring
modern game development resources into the hands of individuals or small, ad-hoc collections of
programmers and designers. These indie game development teams have demonstrated an agility and risktolerance that, in many cases, allows them to push gameplay innovation faster than their big budget
counterparts. A number of shockingly successful indie titles have premiered in recent years, including
Minecraft, Limbo, and Super Meat Boy.
In the rapidly evolving landscape of indie game development, Unity has emerged as something of a de-facto
standard: its low cost, ease of use, and broad feature set make it ideal for rapid game development. Even
large studios such as CCP (Developers of Eve Online) use it for rapidly prototyping game concepts. Unity
provides a game engine in a box a physics and rendering engine with hooks for several scripting
languages, adaptable to virtually any genre of videogame. Unity - Great 3D Games On Multiple Platforms &
Browsers Unity - Great 3D Games On Multiple Platforms & Browsers Read More
While Unity does provide a visual editor for manipulating the game environment, Unity is not a zero
programming game creator tool. Unity requires the ability to program to produce results, but also gives you
a much more flexible and powerful tool than any game maker program possibly could. Unity wont do the
work for you, but it does serve to lower the barrier to entry substantially. Starting completely from scratch
with C++ and OpenGL, it can take days to get to the point where theres actually something rendered
onscreen. Using Unity, it takes about ten seconds. Unity puts the basic elements of game creation into the
hands of novice programmers in a fast, intuitive way.
2. Versions of Unity
Unity comes in two basic flavors: the pro version and the free version. There are a number of differences
(you can see the full list here), but, broadly speaking, the pro version supports a number of visual
improvements (like real-time soft shadows and post-processing), and a large number of relatively minor
features that are extremely helpful for more complex games. That said, for most relatively simple games you
might want to build, the free version of Unity is perfectly adequate. Well break down the key differences
below in more detail for those interested.
2.1 Pricing
The free version of Unity is, of course, free. However, there are a few limitations: the free version of Unity
cannot be licensed to any company with an annual income of more than $100,000. While such organizations
are beyond the scope of this guide, if you suspect you might become such an organization, its probably wise
to spring for the Pro version.
The Pro version of Unity is $75 a month, or $1500 for a permanent license, and has no limits on what you
can do with the games created with it. There is also a 30-day free trial available, which well be using for this
guide, in order to give you as complete an overview of the available features as possible. A one-year student
license is also available through Studica for $129.
2.2 Features
There are many features absent in the free version of Unity. However, the most important differences are as
follows: the free version of Unity lacks a number of rendering options that allow for better-looking, fasterrunning games (LOD support, screen-space post-processing, advanced shaders, real-time soft shadows, and
deferred rendering). It also lacks the full mechanim animation system, and some AI tools. In general, for
complex, large-scale projects, or projects where graphical performance is important, the pro version is
worthwhile. I use the pro version, because I develop virtual reality games for the Oculus Rift, and the screenspace post-processing support is necessary to correctly interact with the headset. Everything You Want To
Know About The Oculus Rift Dev-Kit Everything You Want To Know About The Oculus Rift Dev-Kit The
future is here - the Oculus Rift has finally begun shipping. It's early days yet, but if you're one of the lucky
few who backed or pre-ordered the dev kit, here's a collection of... Read More
You can check out an early alpha build of one of my VR games, BeatRunner. It should give you a sense for
what Unity makes possible.
3. Installing Unity
Unity is straightforward to install. You can download the executable here (for the OSX installer, click the link
that says developing on Mac OSX?). Let it download, run it, and follow the installer instructions. When the
installation is finished, a window entitled activate your Unity license will appear. Check the box marked
activate a free 30-day trial of Unity Pro and click OK.
Congratulations! You know have a 30-day trial of Unity Pro. When the trial expires, if you dont want to buy
the pro version, you can switch to the free version and keep your existing content.
that file to every enemy entity. When you run your game, each enemy will be equipped with a copy of the
Mook object.
Attaching a new script to an object looks like this:
First, select the object and go to the inspector. Then, click on the Add Component button.
Go to new script, enter the name you want, and click create and add.
Now you have a new script, that you can edit by double-clicking on it!
A class file looks something like this:
using UnityEngine;
public class Mook : MonoBehaviour {
private float health;
void Start () {
health = 100;
}
void Update(){
if (health > 0){
//search for player
//if you encounter the player on the road, kill him
//if you get shot, remove a random amount of health
}
}
}
using UnityEngine; This line tells C# that we want to use Unitys libraries, which allow us to
connect to the Unity game engine.
public class Mook : MonoBehaviour { This line actually declared the class and its name (Mook);
private float health; This declares a private class variable (which can only be changed from inside
the class). The variable is given a value in Start().
void Start () { This declares a method called Start. Start is a special method that runs only once,
when the game initially launches.
void Update(){ -Update is another special method, which runs on every frame. Most of your game
logic will go here.
//if you encounter the player on the road, kill him This line is a comment (any line starting with a
double slash is ignored by C#). Comments are used to remind yourself of what particular bits of code
do. In this case, this comment is being used to stand in for a more complicated block of code that
actually does what the comment describes.
Along with Start and Update, you can instantiate your own methods with almost any name. However,
methods that you create wont run unless theyre called. Lets declare a method for a hypothetical class called
myClass that adds two numbers together.
public float addTwoNumbers(float a, float b){
return a+b;
}
This declares a public (accessible to other objects) method that returns a float, called addTwoNumbers,
which takes two floats as input (called a and b). It then returns the sum of the two values as its output.
Calling this method from within the same class (say, from inside Update) looks like this:
Again, this just creates an instance of our class, accesses the appropriate method and feeds it the numbers we
want to add, then stores the result in result. Simple.
If your script is attached to an object that has special properties (like a particle emitter) that cant be accessed
under the normal set of GameObject parameters, you can choose to treat it as a different kind of game entity
by using the GetComponent method.
The syntax for that looks like this:
GetComponent<ParticleSystem>().Play();
If any of this is unfamiliar to you, go back and go through the C# primer. Itll save you a lot of frustration as
we proceed.
5. Unity Basics
In this section, were going to work our way through the basic mechanics of the Unity engine. The workflow
in Unity goes something like this: create an entity to serve a role in the game (blank GameObjects can be
used for abstract logical tasks). Then, either write or find a class file, and add it to the entity as a script (using
the add component button in the inspector view. Then run, test, debug, repeat until it works and move on
to the next element of the game.
Unity comes with a number of basic view tabs that can be laid out in various ways to the taste of the user.
The big five are the game tab, the scene tab, the inspector tab, the project tab, and the hierarchy tab.
The game tab, when the play button is depressed, displays a running instance of the game that the user can
interact with and test. The scene tab provides a static, editable version of the gameworld. The inspector
tab allows the user to modify individual entities in the game world by selecting them in the editor tab. The
project tab allows the user to browse through the projects files and drag models, materials, and other
resources into the editor tab to place them in the gameworld. Finally, the hierarchy tab shows all objects in
the world, allowing you to find distant objects in the scene, and parent entities to one another by clicking and
dragging. See the diagram below for the locations of all these things. Start Creating Games In No Time With
Unity3D Free Start Creating Games In No Time With Unity3D Free Read More
The three main kinds of light are spot, point, and directional. Spot lights have a location in 3D space and
project light only in one direction in a cone of variable angle. These are good for flashlights, searchlights,
and, in general, give you more precise control of lighting. Spot lights can cast shadows. Point lights have a
location in 3D space, and cast light evenly in all directions. Point lights do not cast shadows. Directional
lights, finally, are used to simulate sunlight: they project light in a direction as though from infinitely far
away. Directional lights affect every object in the scene, and can produce shadows.
5.1.6 Particle Systems
Particle systems are the term for Unity GameObjects that generate and control hundreds or thousands of
particles simultaneously. Particles are small, optimized 2D objects displayed in 3D space. Particle systems
use simplified rendering and physics, but can display thousands of entities in real time without stuttering,
making them ideal for smoke, fire, rain, sparks, magic effects, and more.
There are a lot of parameters that you can tweak to achieve these effects, and you can access them by
spawning a particle system under the component editor, selecting the particle system, and then opening the
inspector tab. You can change the size, speed, direction, rotation, color, and texture of each particle, and set
most of those parameters to change over time as well. Under the collision attribute, if you enable it and set
the simulation space to world youll get particles that will collide with objects in the world, which can be
used for a number of realistic particle effects, including rain, moving water, and sparks.
Scale it appropriately, duplicate it, and put a sphere between the paddles for the ball.
Then, create a 3DText object and scale and position it correctly, changing the font size attribute to get a less
pixelated image.
Next, create two particle systems, pick the characteristics you want, and attach them to the paddles.
Next, youll want to position and rotate the camera so that it frames the scene correctly. While the camera is
selected, you can see a small preview of the cameras view in the lower right hand corner.
Before we finish, we need to create two additional cubes to be bumpers, to prevent the ball from bouncing
out of the game area. We can make them invisible by unchecking the mesh renderer in the inspector tab.
If you hit play, you can now see the basic elements of our game laid out. They wont do anything yet, but
well get to that!
Now that weve got that setup, were going to talk about whats involved in scripting these elements to make
a game.
7. Scripting in Unity
Once you have a script attached to an object, you can revise it by double clicking on it in the inspector. This
opens MonoDevelop, the default development environment for Unity. In essence, Monodevelop is a text
editor with features specifically optimized toward programming. Keywords and comments are highlighted in
blue and green, and numerical values and strings appear in red. If youve used Eclipse or other IDEs,
MonoDevelop is very similar. You can build your scripts from inside the editor, to check for syntax errors,
like so: The Basics Of Computer Programming 101 - Variables And DataTypes The Basics Of Computer
Programming 101 - Variables And DataTypes Having introduced and talked a little about Object Oriented
Programming before and where its namesake comes from, I thought it's time we go through the absolute
basics of programming in a non-language specific way. This... Read More
In general, to get your script to interact with Unity, youll need to reference elements that the object holding
the script possesses (you can see a list of these elements under the inspector tab when the relevant object is
selected). You can then call methods or set variables for each of these elements to enact the changes you
want.
If you want a script on an object to affect the properties of a different object, you can create an empty
GameObject variable in your script, and use the inspector to assign it to another object in the scene. The
screenshots below show what that looks like.
A list of the elements an object might have is as follows (taken from the inspector view of one of our paddles
in the above example):
Transform
Box Collider
Mesh Renderer
Each of these aspects of the object can be influenced from within a script. Next, well look at exactly how.
7.1 Transform
The transform functions for a GameObject in Unity control the physical parameters of that object: its scale,
its position, and its orientation. You can access them from within a script like this:
transform.position = newPositionVector3;
transform.rotation = newRotationQuaternion;
transform.localScale = newScaleVector3;
In the above examples, the named variables are of the types specified in the names. There are a few key
details here: position and scale are, as youd expect, stored as Vector3s. You can access the x, y, and z
components of each (for example, transform.position.y gives you the distance of an object above the zero
plane). However, to avoid gimbal lock, rotations are handled as Quaternions (four-component vectors).
Because hand-manipulating quaternions is unintuitive, you can manipulate rotations using Eulerian angles by
using the Quaternion.Euler method like so:
transform.rotation = Quaternion.Euler(pitch, yaw, roll);
If you wish to move objects smoothly from one place to another, youll find the Slerp method for quaternions
and vector3s helpful. Slerp takes in three arguments the current state, the final state, and the speed of
change, and smoothly interpolates between them at the given speed. The syntax looks like this:
transform.position = Vector3.Slerp(startPositionVector3, newDestinationVector3, 1);
7.2 Renderer
The renderer functions in Unity allow you to control the way the surfaces of props are rendered on-screen.
You can reassign the texture, change the color, and change the shader and visibility of the object. The syntax
looks like this:
renderer.enabled = false;
renderer.material.color = new Color(0, 255, 0);
renderer.material.mainTexture = myTexture;
renderer.material.shader = newShader;
Most of these have pretty clear functions. The first example makes the object in question invisible: a useful
trick in a number of situations. The second example assigns a new RGB color (namely, green) to the object in
question. The third assigns the main diffuse texture to a new Texture variable. The last example changes the
shader of the objects material to a newly defined shader variable.
7.3 Physics
Unity comes with an integrated physics engine that allows you to assign the physical properties of objects
and let the details of their simulation be handled for you. In general, rather than trying to implement your
own physics using a textbook and the transform system, it is simpler and more robust to use Unitys physics
engine to the greatest extent possible. Smash, Drive & Build: 3 Awesome Physics Sandboxes Simulators
Smash, Drive & Build: 3 Awesome Physics Sandboxes Simulators Read More
All physics props require colliders. However, the actual simulation itself is handled by a rigidbody, which
can be added in the inspector view. Rigidbodies can be kinematic or nonkinematic. Kinematic physics props
collide with (and effect) nonkinematic physics props around them, but are unaffected by collision
themselves. Static kinematic props are the proverbial immoveable objects, and moving kinematic objects are
the proverbial unstoppable force (for the record, when they collide, they simply pass through each other).
Beyond that, you can adjust the angular drag of the object (how much energy it takes to spin it), change its
mass, dictate whether or not its affected by gravity, and apply forces to it.
Examples:
rigidbody.angularDrag = 0.1f;
rigidbody.mass = 100;
rigidbody.isKinematic = false;
rigidbody.useGravity = true;
rigidbody.AddForce(transform.forward * 100);
These are all pretty self-explanatory. The only thing to note here is the use of transform.forward. Vector3s
all have three components(.forward, .up, and .right) associated with them, which can be accessed and rotates
with them (forward is the direction of the blue arrow in the editor). transform.forward is simply the
forward vector for the current object with magnitude 1. It can be multiplied by a float to create more force on
the object. You can also reference transform.up and transform.right, and negate them to get their
reverses.
7.4 Collision
Often, when building a game, youd like a collision to result in some change-of-state in your code, beyond
just physics simulation. For this, youll need a collision detection method.
Theres a certain amount of prep work needed to detect collisions in Unity. First, at least one of the objects in
the collision needs a non-kinematic rigidbody attached to it. Both objects must have correct colliders, set to
be non-triggers. The total speed of both objects must be low enough that they actually collide, instead of
simply skipping through one another.
If youve got all that taken care of, you can check for collision by placing a special collision detection
method in a script attached to the object youd like to check collision with. The method will look like this:
void OnCollisionEnter(Collision other){
This method will automatically run during the first frame that another object touches your object. The
collision entity other is a reference to the object that you hit. You can, for example, reference its
gameobject, rigidbody, and transform characteristics to manipulate it in various ways. While
OnCollisionEnter is probably the most common function youll be using, you can also use
OnCollisionExit and OnCollisionStay (with otherwise identical syntax and usage), which activate during
the first frame that you stop colliding with an object and during every frame that youre colliding with an
object, respectively.
Sometimes, it can also be useful to do whats called raycasting. In raycasting, an infinitely thin line (a ray)
is cast through the world from some origin, along some vector, and, when it hits something, the position and
other details of the first collision are returned. The code for a raycast looks like this:
RaycastHit hit;
if (Physics.Raycast(transform.position, -Vector3.up, out hit)){
float distanceToGround = hit.distance;
}
This casts a ray from the position of the current object along -Vector3.up (straight down), and links the
variable hit to the first object it collides with. Once your ray has hit something, you can access hit.distance
to determine how far away it is, or hit.GameObject to manipulate the object you hit.
Raycasts like this can be used for shooters to determine what the guns pointed at, or to select objects when
the camera looks at them, or for certain styles of movement mechanic.
You can use myAudioSource.Pause() and myAudioSource.Play() to control those sound files. You can adjust
the falloff behaviors, volume, and doppler shifting of the sounds under the inspector tab for the
audiosource.
7.7 Input
A game that doesnt take any input from the user isnt much of a game. There are a lot of different kinds of
input you can read in, and almost all of them are accessible through the Input and KeyCode objects. Some
sample input statements (which have a values evaluated every frame) are below.
The functions of these lines is mostly self explanatory. Using these three kinds of input reference, you can
reconstruct the control schemes of most modern 3D computer games.
These bugs are typically not the most difficult to fix. What can be more problematic are subtle semantic
errors, in which you have successfully written a file full of valid C# just not one that does what you thought
it would. If you have one of these errors, and youre having trouble tracking it down, there are a few things
you can try to improve the situation.
The first is to pause the execution of the game, and check the console. You can pause the game by clicking on
the pause icon in the upper middle portion of the editor, and then selecting console from the bottom of the
window menu (or pressing Ctrl-Shift-C). Even if there are no errors, warnings can still help to give some
clues as to what might be going wrong.
If this doesnt work, you can also try to get some idea about the state of your script by printing the state of
internal variables to validate that the program is doing what you think its doing. You can use
Debug.Log(String); to print the contents of a string to the console when the program execution hits that line.
In general, if you work backwards from what you think should be happening through the things that should
be making it happen, eventually you will reach a point where your debug prints dont do what you expect
them to do. Thats where your error is.
You can download my Pong demo, if youd like to see everything Ive outlined in action. It runs on
Windows, Mac and Linux systems.
The process from there is self explanatory: select your options, and hit build; the game will prompt you for
a directory to install to, and will place both the executable and data directory there. These two files can be
zipped together and distributed (just make sure you arent charging for a game built in the Unity demo, as
this violates the terms of service).
Latest Giveaways
UHANS H5000 Review and Giveaway
Trending
Linux
Related Articles
DIY
Latest Deals
Pay What You Want: Hardcore Game Dev Bundle
$1601.00 $1
EasilyDo: Lifetime Subscription
Shortcodes are small snippets of text that you can introduce into a blog post, page or PHP file to add new
features. These features will be coded into a separate file that you dont need to access all you need to do is
use the format [shortcode] to add the visual enhancement, embedded media or layout change to your blog.
Shortcodes Ultimate is particularly good. It offers over 40 useful shortcodes many with conditions that can
be used to tailor their use that cover everything from adding spoiler tags and other accordion-like hidden
areas to animations, buttons, icons and even formatting your pages and posts into columns.
Wielding the power of CSS3, Shortcodes Ultimate also provides you with a useful button for adding
shortcodes in the post/page editing screen. Available free, the plugin offers a premium upgrade for $25 which
offers an additional 15 shortcodes (including a content slider and a splash screen), 60 new skins and a
shortcode creator. These can also be purchased separately as Add-ons.
To see a full list of options available with this powerful plugin, use the Shortcodes > Examples page.
We recommend that, if you are installing plugins, you first make a backup of your WordPress sites theme
and database. You might do this through your web hosts CPanel or similar software, or by employing a
plugin such as Updraft.= How To Backup & Restore Your WordPress Site Easily With UpdraftPlus How To
Backup & Restore Your WordPress Site Easily With UpdraftPlus Read More
1. Pullquotes: If you want to enhance the layout of your blog by focussing on the content, you might
choose to use blocks of text that are left or right aligned to draw attention to particular sections of the
post. These are pullquotes and can be invoked with Shortcodes Ultimate using the [pullquote
align=left|right][/pullquote] tags.
2. Columns: You can introduce a variety of column-based layouts to your WordPress posts and pages
with Shortcodes Ultimate. For instance, you can use [column size=1/2]Content Column
1[/column] [column size=1/2]Content Column 2[/column] to create a page with two equal-width
columns. There are many varieties, such as a page split into three equal-width columns, or one with a
half-page column and two quarter-page columns. You can even combine column layouts by wrapping
the [column][/column] shortcodes with [row] and [/row] (There are many ways in which shortcodes
can be combined, creating stunning effects).
3. Third party and self-hosted content can also be added with a shortcode. While you probably wont
bother with YouTube (pasting a URL into a blog post is simpler than [youtube
url=http://youtube.com/watch?v=CODESTRING], after all) self-hosted clips can be added with
. Advanced options can be introduced for YouTube, such as the removal of the player controls, and
autoplay.
If you need to adjust the CSS for a pullquote, quote or shortcode, use the Shortcodes > Custom CSS tab to
add your own code. Stuck with or intimidated by CSS? We have several guides on MakeUseOf dealing with
this subject, and a good place to start is James 5 Baby Steps To Learning CSS. 5 Baby Steps To Learning
CSS & Becoming A Kick-Ass CSS Sorcerer 5 Baby Steps To Learning CSS & Becoming A Kick-Ass CSS
Sorcerer CSS is the single most important change webpages have seen in the last decade, and it paved the
way for the separation of style and content. In the modern way, XHTML defines the semantic structure...
Read More
First of all, and most common, is the loss of shortcodes when you update the plugin. Recently, the developers
of Shortcodes Ultimate have introduced an update that changes the shortcode format from [shortcode] to
[su_shortcode], and there is every chance that they might do this again in future.
Fortunately, you can change the format of your shortcode by opening Shortcodes > Settings in the
WordPress admin page, and change or clear the entry in the Shortcodes prefix field.
You may also find that Shortcodes Ultimate prevents your blog from opening after install. If this happens, it
will probably because your current theme is already hardcoded to run a shortcode that conflicts with those on
offer in Shortcodes Ultimate. You can troubleshoot this by switching to the WordPress default theme
checking with the developer of the theme should offer a long term solution.
Conclusion
I discovered Shortcodes Ultimate while looking for a good option to cover up spoilers on my TV themed
website. The wealth of options on offer at first seemed like overkill, but over time Ive used more and more
of the layout enhancement offered by Shortcodes Ultimate, and would certainly recommend it to any
WordPress blog owner.
Easy to install and simple to use, Shortcodes Ultimate is among the upper echelon of WordPress plugins.
Quite simply, everyone should have a copy, which is why we include it the MakeUseOf Best of WordPress
Plugins list.
Latest Giveaways
UHANS H5000 Review and Giveaway
Trending
Linux
Related Articles
Internet Self Improvement
Latest Deals
PureVPN: Lifetime Subscription
In an eye tracking study conducted by the Nielsen Norman Group, researchers found that on the Internet,
readers first read horizontally across the top of the page a couple of times, and then they scan down the left
side of the page. What this study reveals is that readers will use headers as a tool to identify the content thats
important to them. So, if you care about providing what your readers want, then whether you order headers
from large to small doesnt matter as much as filling headers with informative words that actually tell readers
what the section is about, and placing them evenly throughout the article to organize it well.
You may think youre being witty and creative with those headlines, but if you arent describing the section,
you really arent doing anyone any favors.
A tip for using <blockquote> in your articles: dont overdo it. One or two short quotes in an article thats
about 800 to 1000 words is more than enough. It gives not only the ability to give the eye a break from
paragraphs, but it lets you bring in quotes from outside experts, which further bolsters the credibility of your
article. You cant lose.
Youll notice that the images are spaced just far enough apart so that by the time youve scrolled a little bit,
the eye is aware of another image coming up below. Its not something thats done only for the psychological
impact of drawing the eye down the article it just makes for a much more enjoyable read and a better
looking article.
With that said, if the blog or website youre writing for doesnt have the real-estate on the page for big, fullwidth pictures like this, then at the very least you should make use of smaller images that are aligned to the
left or the right throughout the article. When I do this on my own blog, I actually like to alternate from left to
right just to change things up as the article flows down the page.
Aligning images with the text wrapping around like this is usually just a simple matter of setting the align
class to right or left in the <img> tag, but always check with the blog or website owner youre writing
for to find out if theres any CSS styling that makes use of something like whats known as the float
property to do alignments. There may be specific syntax you need to use to align images like this depending
on the CSS styling, so take the time to ask the designer. Its well worth the effort, and will make for a much
more attractive article.
It sounds simple, but sometimes theres a grey line. For example, listing reasons why using a wireless
network can be unsecure would require a list without numbers, because really it doesnt matter how many
there are theyre just reasons. On the other hand, when youre giving steps in a process or some procedure
where the order of the list matters, the numbers make sense. Dont use numbers if you dont have to, because
they can make your list awkward. Bulleted lists can go a really long way toward improving the layout of
your article so having at least one, if its appropriate for the topic, is a very good idea.
Non-Obtrusive Ads
How you place an ad into your article can really make the difference when it comes to not losing your
readers because of it. Really, many readers are accustomed to the idea of ads and why they are necessary to
pay for content, but what annoys readers and drives them away (or forces them to use those horrible adblockers) is ads that pop-up, block text, or are camouflaged to look like part of an article. Dont do that.
Instead, use ads with clear borders, and utilize the CSS float method to make text wrap around it (unless
youre placing it in the sidebar). This is what that looks like:
<span id=more-xxxxx>
<div style=float: right;>
<script type=text/javascript><!
google_ad_client = ca-pub-xxxxxxxxxxxxx;
google_ad_slot = xxxxxxxx;
google_ad_width = 300;
google_ad_height = 250;
//>
</script><br />
<script type=text/javascript
src=http://pagead2.googlesyndication.com/pagead/show_ads.js>
</script></div>
The float:right; will place it in the text where you need, and you can automate this in WordPress by using
templates like Ive described in past articles. This removes the need to place the ad into every single article.
As you can see, the ad is large enough to attract attention, but it isnt camouflaged or blocking any text, so if
readers want they can just ignore it and read on. No problem. How To Use A Wordpress Content Template To
Write Faster How To Use A Wordpress Content Template To Write Faster Wordpress is a brilliant invention,
and has made it possible for more and more people to have amazing websites, with beautiful themes.
However, there is still the matter of the content area, which still needs... Read More
The worst thing you can do with your articles is overdo it with ads and drive off readers (and in many cases
you may not even have to worry about ads, like if youre writing for a client). However, as your own blog
owner, these are the kinds of things that you need to consider when youre writing articles on your site, and
these basic ad formatting tips can make a big difference with how your ad is perceived.
Crediting Sources
The worst thing about the Internet right now is really the content thievery that takes place and Im not only
talking about the lowlifes that scrape the net for content and copy it onto their own low-quality spam sites,
set up only for Google traffic. No, even the largest and most popular websites both major blogs and news
media outlets have a very bad habit of stealing news stories and scoops from smaller bloggers and
websites, adding a few extra quotes, and claiming the idea as their own. Its horrible and pretty unethical, but
it happens. That doesnt mean you should follow suit. In fact, it makes sense that citing high-quality sources
to back up article claims would get your website identified as a high-quality source of reliable information.
Thats SEO gold right there. RefDot: Makes Citing Sources From The Web Easy RefDot: Makes Citing
Sources From The Web Easy Read More
However, you also dont want that text to stand out as important content at the footer of your article. A
common approach to citing story sources or image sources at the footer of an article is to use the <small> tag,
which forces the font down one size. Its a great way to format copyright info, legal comments, and credits. It
provides the information needed, but doesnt distract from the actual conclusion of the article itself.
Of course, the tips above are the bare basics that any online writer should learn, but if youre interested in
digging deeper there are lots of resources. Check out my article listing some great websites where you can
learn HTML code. Tina has also detailed some additional, useful HTML effects you could add to your site.
If you want to really go crazy, there are also resources out there to learn CSS as well. 8 Best Websites For
Quality HTML Coding Examples 8 Best Websites For Quality HTML Coding Examples Read More
The simple truth of the matter is that writing online takes more than just the creativity required to write
something for a print publication. Internet publication means you need to understand not only the basic codes
behind websites, but also when and why you should make use of them.
Latest Giveaways
UHANS H5000 Review and Giveaway
Trending
Linux
Gaming
Related Articles
Deals
Latest Deals
Pay What You Want: White Hat Hacker 2017 Bundle
At $99 for a single site licence this one doesnt come cheap, but it makes such a dramatic and professional
difference that it should easily be worth the cost on an appropriate site.
MailChimp Integration($15)
A complete integration of MailChimp into WooCommerce. If you arent already using MailChimp for
sending newsletters, you should be. It has awesome WYSIWYG template building and is totally free for
small lists, with affordable, scalable pricing. This plugin is a must to connect the two: adding subscription
options to checkout, widgets for your front-end, and short codes to add sign-up forms anywhere. In addition,
theres a whole range of advanced features for auto-responders such as checking up on how a purchase is
working out. For $15 this is a ridiculous amount of features, making this one an absolute must.
If youd rather do this the DIY way, I wrote a tutorial on displaying hidden content only after a share action
had taken place, but its more limited in that it can only reveal the discount code and youll need to edit
templates yourself. A worthy $20 to get it done automatically, if you ask me. Make Your Own Tweet/Like/+1
To Unlock System with jQuery Make Your Own Tweet/Like/+1 To Unlock System with jQuery Going viral
used to mean a disease epidemic, but now it's something all content creators crave. You could rely on the
quality of your content alone - if it's good enough, people will share it,... Read More
If youve set your own WooCommerce shop, what problems have you faced? Did a plugin help? Which
plugins have you found that really boosted sales? Lets talk below, okay?
If you need a web host to set up your online web store, sign up for Bluehost at just $3.95/month.
Previous PostContact Form 7: The Best Contact Form Plugin For WordPressNext PostNot Just For
Developers: 7 HTML Tags Any Writer Should Know
Latest Giveaways
Trending
Linux
Related Articles
Internet
Deals
Latest Deals
Advertisement