Author Archives: Johannes Westberg

About Johannes Westberg

2014  Programming

Neiva programming blog 3

I’ve been programming the main player character. That includes movement, jumping, groundchecking, health, sticking to platforms and physics… At the beginning I create one whole Unity script that handled all that, till reacently when we had to change from Unity’s 2D physics to 3D physics. I split up the script to mulitple scripts/components that handled specific tasks.

The picture above is before separated components. The picture under is after, with separated components.

This approach has led to more reusable code because you […]

/ Comments Off on Neiva programming blog 3
Program: Programming

Neiva programming blog 3

I’ve been programming the main player character. That includes movement, jumping, groundchecking, health, sticking to platforms and physics… At the beginning I create one whole Unity script that handled all that, till reacently when we had to change from Unity’s 2D physics to 3D physics. I split up the script to mulitple scripts/components that handled specific tasks.

The picture above is before separated components. The picture under is after, with separated components.

This approach has led to more reusable code because you […]

/ Comments Off on Neiva programming blog 3
Program: Programming

Neiva programming blog 2

I’ve been working on the player character movement. That includes running, jumping, land on moving platforms, move WITH moving platforms and more… I’ll now talk about how I created the jumping movement.
In the Neiva game we have the main character the player controls: NEIVA. It’s a two legged little creature that looks cute, colorful and non-realistic. In the game, we did not want realistic movement. A realistic jump would be a single jump force up from the ground and then […]

/ Comments Off on Neiva programming blog 2
Program: Programming

Neiva programming blog 2

I’ve been working on the player character movement. That includes running, jumping, land on moving platforms, move WITH moving platforms and more… I’ll now talk about how I created the jumping movement.
In the Neiva game we have the main character the player controls: NEIVA. It’s a two legged little creature that looks cute, colorful and non-realistic. In the game, we did not want realistic movement. A realistic jump would be a single jump force up from the ground and then […]

/ Comments Off on Neiva programming blog 2
Program: Programming

Neiva programming blog 1

Project Neiva is a new game project with a group of seven students. The game is a 2.5D sidescrolling platformer where the player run, jumps and uses projectiles to teleport through tricky obstacles. The project is part of the course Big Game Project that lasts in 8 weeks until exhibition in the yearly Gotland Game Conference.

This blog is about game programming. In upcoming  blog posts I’ll write about tasks, progression, decisions makings, problems and good things that happens in the […]

/ Comments Off on Neiva programming blog 1
Program: Programming

Neiva programming blog 1

Project Neiva is a new game project with a group of seven students. The game is a 2.5D sidescrolling platformer where the player run, jumps and uses projectiles to teleport through tricky obstacles. The project is part of the course Big Game Project that lasts in 8 weeks until exhibition in the yearly Gotland Game Conference.

This blog is about game programming. In upcoming  blog posts I’ll write about tasks, progression, decisions makings, problems and good things that happens in the […]

/ Comments Off on Neiva programming blog 1
Program: Programming

Code review för Semihs LinkedList och BinarySearchTree

————-Linked List————-
Metoden Find saknas i LinkedList. En Find-metod ska finnas enligt uppgiften.
Övriga metoder fungerade bra. Genom unit-testing upptäcktes inga fel. Metoderna gjorde så som man förväntade sig. Genom visual studios debuggnings-verktyg gick det även att se att elementen i listan placerades korrekt efter användning av metoderna.
Petitesser:
..skulle placera ‘Node’ structen i samma .h-fil som ‘LinkedList’, förslagsvis som private i LinkedList-klassen, för att göra ‘LinkedList’ oberoende av andra lösa filer (Node.h).
Namnge ‘leftNode’ och ‘rightNode’ som ‘previousNode’ och ‘nextNode’ för tydlighet (enligt mig…). […]

/ Comments Off on Code review för Semihs LinkedList och BinarySearchTree
Program: Programming

Code review för Semihs LinkedList och BinarySearchTree

————-Linked List————-
Metoden Find saknas i LinkedList. En Find-metod ska finnas enligt uppgiften.
Övriga metoder fungerade bra. Genom unit-testing upptäcktes inga fel. Metoderna gjorde så som man förväntade sig. Genom visual studios debuggnings-verktyg gick det även att se att elementen i listan placerades korrekt efter användning av metoderna.
Petitesser:
..skulle placera ‘Node’ structen i samma .h-fil som ‘LinkedList’, förslagsvis som private i LinkedList-klassen, för att göra ‘LinkedList’ oberoende av andra lösa filer (Node.h).
Namnge ‘leftNode’ och ‘rightNode’ som ‘previousNode’ och ‘nextNode’ för tydlighet (enligt mig…). […]

/ Comments Off on Code review för Semihs LinkedList och BinarySearchTree
Program: Programming

Code review för Jens LinkedList och BinarySearchTree

——- LINKED LIST ——–
Linked List fungerar som ska. Genom unit-testing upptäcktes inga fel. Metoderna gjorde så som man förväntade sig. Genom visual studios debuggnings-verktyg gick det även att se att elementen i listan placerades korrekt efter användning av metoderna.
I konstruktorn för LinkedList sätts inte m_root till nullptr. Koden fungerar ändå som det ska, men att ha satt m_root till nullptr manuellt hade bidragit till mer tydlighet (enligt mig).
LinkedList printar saker i konsollen genom  vissa metoder resulterar i olika saker. Eftersom […]

/ Comments Off on Code review för Jens LinkedList och BinarySearchTree
Program: Programming

Code review för Jens LinkedList och BinarySearchTree

——- LINKED LIST ——–
Linked List fungerar som ska. Genom unit-testing upptäcktes inga fel. Metoderna gjorde så som man förväntade sig. Genom visual studios debuggnings-verktyg gick det även att se att elementen i listan placerades korrekt efter användning av metoderna.
I konstruktorn för LinkedList sätts inte m_root till nullptr. Koden fungerar ändå som det ska, men att ha satt m_root till nullptr manuellt hade bidragit till mer tydlighet (enligt mig).
LinkedList printar saker i konsollen genom  vissa metoder resulterar i olika saker. Eftersom […]

/ Comments Off on Code review för Jens LinkedList och BinarySearchTree
Program: Programming

My summer game project

This week I started with a new game project. The project is sort of a summer course (during 9 weeks) where students and I from the Game Programming program in Uppsala University have the opportunity to develop our skill on game programming. It’s my first year in this school so I have still much to learn.
In this blog I’ll share my thoughts and decisions that I make during the process of this project. It’s C++-programming so mostly all my blog-posts […]

/ Comments Off on My summer game project
Program: Programming

My summer game project

This week I started with a new game project. The project is sort of a summer course (during 9 weeks) where students and I from the Game Programming program in Uppsala University have the opportunity to develop our skill on game programming. It’s my first year in this school so I have still much to learn.
In this blog I’ll share my thoughts and decisions that I make during the process of this project. It’s C++-programming so mostly all my blog-posts […]

/ Comments Off on My summer game project
Program: Programming

Generating our maps

I’ll talk about how we manage to create maps in our game Green Warden in a way so our designer understand how to write new maps and send them as textfiles to us programmers to implement in th game.
I encouraged our designer to use the free-to-download program Tiled (http://www.mapeditor.org/) to create new maps. With Tiled it’s possible to save what you do as textfiles. We’re using these textfiles to load different maps. In this way our designer doesn’t have […]

/ Comments Off on Generating our maps
Program: Programming

Generating our maps

I’ll talk about how we manage to create maps in our game Green Warden in a way so our designer understand how to write new maps and send them as textfiles to us programmers to implement in th game.
I encouraged our designer to use the free-to-download program Tiled (http://www.mapeditor.org/) to create new maps. With Tiled it’s possible to save what you do as textfiles. We’re using these textfiles to load different maps. In this way our designer doesn’t have […]

/ Comments Off on Generating our maps
Program: Programming

My first A*pathfinding

This week my job has been to create a pathfinding system for our game Green Warden. For tower-defence-like game it needs a pathfinding system thats not just functional but also cheap for the processor to handle. As some probably know a tower-defence game could have hundreds of enemies on screen at the same time searching their way through a maze and obstacles. Sometimes the enemies must also be able to interrupt their current path to attack nearby towers and then, […]

/ Comments Off on My first A*pathfinding
Program: Programming

My first A*pathfinding

This week my job has been to create a pathfinding system for our game Green Warden. For tower-defence-like game it needs a pathfinding system thats not just functional but also cheap for the processor to handle. As some probably know a tower-defence game could have hundreds of enemies on screen at the same time searching their way through a maze and obstacles. Sometimes the enemies must also be able to interrupt their current path to attack nearby towers and then, […]

/ Comments Off on My first A*pathfinding
Program: Programming

fixed TileMap

The game I’m working on, as a programmer, is (temporary called) Green Warden. This game is sort of a Tower Defence where the player runs around with an avatar, planting seeds that grow up to projectile-shooting trees (towers) against army of lumberjacks (and flamethrowers).
When the players are building their trees/towers we wanted each tower to fit in in a fixed grid of tiles; like chess, where only one piece can be place on one tile.
I wrote a tile map class […]

/ Comments Off on fixed TileMap
Program: Programming

fixed TileMap

The game I’m working on, as a programmer, is (temporary called) Green Warden. This game is sort of a Tower Defence where the player runs around with an avatar, planting seeds that grow up to projectile-shooting trees (towers) against army of lumberjacks (and flamethrowers).
When the players are building their trees/towers we wanted each tower to fit in in a fixed grid of tiles; like chess, where only one piece can be place on one tile.
I wrote a tile map class […]

/ Comments Off on fixed TileMap
Program: Programming

switch (5 in a Row) – WIP


This week has been filled with new terms like Polymorphism, friend classes, virtual methods, forward declare, finite state machines… My brain feels melted. As a novice programmer these things may need some time to fully understand.
To help find my confidence again I decided to create a simple code for the game ”5 in a row”. Originally it’s a board game where two players by turns drop bricks on the top of the board where you can see the pieces […]

/ Comments Off on switch (5 in a Row) – WIP
Program: Programming

switch (5 in a Row) – WIP


This week has been filled with new terms like Polymorphism, friend classes, virtual methods, forward declare, finite state machines… My brain feels melted. As a novice programmer these things may need some time to fully understand.
To help find my confidence again I decided to create a simple code for the game ”5 in a row”. Originally it’s a board game where two players by turns drop bricks on the top of the board where you can see the pieces […]

/ Comments Off on switch (5 in a Row) – WIP
Program: Programming

switch (5 in a Row) – WIP


This week has been filled with new terms like Polymorphism, friend classes, virtual methods, forward declare, finite state machines… My brain feels melted. As a novice programmer these things may need some time to fully understand.
To help find my confidence again I decided to create a simple code for the game ”5 in a row”. Originally it’s a board game where two players by turns drop bricks on the top of the board where you can see the pieces […]

/ Comments Off on switch (5 in a Row) – WIP
Program: Programming

switch (5 in a Row) – WIP


This week has been filled with new terms like Polymorphism, friend classes, virtual methods, forward declare, finite state machines… My brain feels melted. As a novice programmer these things may need some time to fully understand.
To help find my confidence again I decided to create a simple code for the game ”5 in a row”. Originally it’s a board game where two players by turns drop bricks on the top of the board where you can see the pieces […]

/ Comments Off on switch (5 in a Row) – WIP
Program: Programming

Squash (pong mod)

This is sort of a late blog post due to a busy weekend, so I’m posting now.
(Sorry if the language is confusing somewhere)
Last week we learned some fundamentals of programming by creating the simple game Pong. Allthough the simplicity I think I’ve learned alot from that!
I’ve been tweeking around on the Pong-code we did and made my own little game: Squash (it’s not complete though)
So basically, the mechanics are kind of the same as Pong, but instead of having […]

/ Comments Off on Squash (pong mod)
Program: Programming

Squash (pong mod)

This is sort of a late blog post due to a busy weekend, so I’m posting now.
(Sorry if the language is confusing somewhere)
Last week we learned some fundamentals of programming by creating the simple game Pong. Allthough the simplicity I think I’ve learned alot from that!
I’ve been tweeking around on the Pong-code we did and made my own little game: Squash (it’s not complete though)
So basically, the mechanics are kind of the same as Pong, but instead of having […]

/ Comments Off on Squash (pong mod)
Program: Programming