Adam's Lair Forum

game development and casual madness
It is currently 2020/01/28, 19:26

All times are UTC + 1 hour [ DST ]




Post new topic Reply to topic  [ 34 posts ]  Go to page 1, 2, 3, 4  Next
Author Message
PostPosted: 2014/04/17, 12:47 
Forum Addict
Forum Addict
User avatar

Joined: 2013/09/19, 14:31
Posts: 883
Location: Italy
Role: Hobbyist
Hi all,

I think it's time that I start to give back something to the Duality community and so I began writing some tutorials, which I hope will be of some use :mrgreen:

I will try to keep simple but at the same time I am targeting an audience that at least knows what Duality is and how to move around it.
I will also try to cover a range of topics as wide as possible while keeping in the scope of the project.

The first thing I am going to do is a Breakout clone.
Part 1 here
Part 2 here
Part 3 here

Let me know what you think :D too long? too short? too difficult? unclear instructions? all feedback is welcome

_________________
Come on Duality's Discord channel. We have cookies! :mrgreen:


Last edited by SirePi on 2015/03/04, 08:13, edited 2 times in total.

Top
 Profile  
 
PostPosted: 2014/05/07, 17:31 
Forum Addict
Forum Addict
User avatar

Joined: 2013/09/19, 14:31
Posts: 883
Location: Italy
Role: Hobbyist
part 2 is live! see first post!

_________________
Come on Duality's Discord channel. We have cookies! :mrgreen:


Top
 Profile  
 
PostPosted: 2014/05/17, 15:33 
Novice Member
Novice Member
User avatar

Joined: 2014/05/17, 14:32
Posts: 21
Location: Czech Republic
Role: Hobbyist
Great work! Thank you.
Just one note. I am not sure who should be the autience of your tutorial but I would probably add more informations about the properties you are setting. Like what exactly is the AngularDamping or Restitution. I like tutorials where I can learn something more than just how to do specific thing step by step.


Top
 Profile  
 
PostPosted: 2014/05/17, 18:27 
Forum Addict
Forum Addict
User avatar

Joined: 2013/09/19, 14:31
Posts: 883
Location: Italy
Role: Hobbyist
Thanks for the feedback, that's exactly what I was looking for! Unfortunately it's not a period with a lot of free time so I still need a little before I will be able to finish the tutorial.

In the meantime I will see what I can do about explaining better the various properties I am using :)

Hope I can post the final part soon!

_________________
Come on Duality's Discord channel. We have cookies! :mrgreen:


Top
 Profile  
 
PostPosted: 2014/05/23, 14:09 
Forum Addict
Forum Addict
User avatar

Joined: 2013/09/19, 14:31
Posts: 883
Location: Italy
Role: Hobbyist
Part 3 online :)

See first post for details!

_________________
Come on Duality's Discord channel. We have cookies! :mrgreen:


Top
 Profile  
 
PostPosted: 2014/05/24, 10:41 
Site Admin
Site Admin
User avatar

Joined: 2013/05/11, 22:30
Posts: 2073
Location: Germany
Role: Professional
Really like the looks of it. You're doing a good job explaining what you're doing and why you're doing it this way, provide a lot of step-by-step source code examples and even have nice formatting for menus and class names. I think this will be a great resource für Duality newbies to get into it, once it's finished :)

Have you considered to post this in other communities as well? I'm a little worried that your tutorial series won't get the attention it deserves, since we're still a little small in numbers here. Also, tutorials are a good way of spreading the word and sparking interest, so they might even contribute to leading some people here in the long run. :)

_________________
Blog | GitHub | Twitter (@Adams_Lair)


Top
 Profile  
 
PostPosted: 2014/05/24, 11:05 
Forum Addict
Forum Addict
User avatar

Joined: 2013/09/19, 14:31
Posts: 883
Location: Italy
Role: Hobbyist
Thanks :mrgreen: glad to be doing my part.

About publishing the tutorial to other places, yes I thought of that.. I am just waiting to have it completed so it can look more "professional" to people outside the community.

And I just noticed that there are a bunch of errors in the code of the 3rd part.. unfortunately I had some issues with my ISP yesterday and it seems that the gists (the pieces of source code in the tutorial) were not updated correctly. :S
Since I don't have access to the source files now, I tried to fix them by memory. Hopefully it should be fine now. Anyway, monday I'll give a review and fix what needs to be fixed.

Until then, don't trust part 3 :)


All sources fixed!

_________________
Come on Duality's Discord channel. We have cookies! :mrgreen:


Top
 Profile  
 
PostPosted: 2015/01/13, 06:23 
Novice Member
Novice Member

Joined: 2015/01/12, 03:26
Posts: 22
Role: Hobbyist
Hello there! It seems that every time i run the code, I receive this error:
An unhandled exception of type 'System.NullReferenceException' occurred in GamePlugin.core.dll
Additional information: Object reference not set to an instance of an object.


The error came from this code: if (DualityApp.Keyboard.KeyPressed(Key.Space) && Ball.Transform.Vel.Length == 0)

I'm kinda new here and I'd really appreciate every help that I may receive is this matter. Thank you in advance!

Code:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

using Duality;
using OpenTK;
using OpenTK.Input;

namespace Breakout
{
    [Serializable]
    public class InputController : Component, ICmpUpdatable
    {
        public GameObject Paddle { get; set; }
        public GameObject Ball { get; set; }


        public float PaddleSpeed { get; set; }
        public float BallInitialSpeed { get; set; }

        void ICmpUpdatable.OnUpdate()
        {
            float secondsPassed = Duality.Time.LastDelta / 1000;
            float movement = PaddleSpeed * secondsPassed;

            if (DualityApp.Keyboard.KeyPressed(Key.Left))
            {
                Paddle.Transform.MoveBy(new Vector2(-movement, 0));
            }
            if (DualityApp.Keyboard.KeyPressed(Key.Right))
            {
                Paddle.Transform.MoveBy(new Vector2(movement, 0));
            }

            if (DualityApp.Keyboard.KeyPressed(Key.Space) && Ball.Transform.Vel.Length == 0)
            {
                Ball.RigidBody.ApplyLocalImpulse(Vector2.UnitY * BallInitialSpeed);
            }
        }
    }
}


Top
 Profile  
 
PostPosted: 2015/01/13, 09:43 
Forum Addict
Forum Addict
User avatar

Joined: 2013/09/19, 14:31
Posts: 883
Location: Italy
Role: Hobbyist
DarkMotoMark wrote:
An unhandled exception of type 'System.NullReferenceException' occurred in GamePlugin.core.dll
Additional information: Object reference not set to an instance of an object.


The error came from this code: if (DualityApp.Keyboard.KeyPressed(Key.Space) && Ball.Transform.Vel.Length == 0)


Hey, welcome :)

if that's the line raising the exception, I think the only plausible reason is that you didn't assign the "Ball" GameObject to the "Ball" Property in the editor.

Can you check?

_________________
Come on Duality's Discord channel. We have cookies! :mrgreen:


Top
 Profile  
 
PostPosted: 2015/01/14, 07:57 
Novice Member
Novice Member

Joined: 2015/01/12, 03:26
Posts: 22
Role: Hobbyist
Thanks for the reply SirePi! Here's how i put everything together. Is everything in order? I followed everything in the instruction but I'm kinda lost when I tied running it for several times. Thanks!

Image


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 34 posts ]  Go to page 1, 2, 3, 4  Next

All times are UTC + 1 hour [ DST ]


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Jump to:  
Powered by phpBB® Forum Software © phpBB Group