Welcome, Guest. Please login or register.

Login with username, password and session length

 
Advanced search

1411283 Posts in 69325 Topics- by 58380 Members - Latest Member: bob1029

March 29, 2024, 02:11:07 AM

Need hosting? Check out Digital Ocean
(more details in this thread)
  Show Posts
Pages: [1]
1  Developer / Technical / Re: General thread for quick questions on: December 06, 2016, 03:26:42 AM
In JavaScript: say I have array A and array B. Some of the contents of these arrays may overlap. (e.g. A[0] might be the same object as B[4])

What would be the quickest way to get an array containing all elements in A that are not in B and an array with all elements of B that are not in A?
2  Developer / Technical / Re: Differences in result when code goes in draw/step event on: September 26, 2016, 08:03:37 AM
Your image link is dead, but from your explanation I think I know whats going on.

You are using a global variabele, meaning it's value is shared between all instances. When one ground object detects the player standing on it, it sets the value to true, but then the next object does the same check and sets it back to false. Remember dat first ALL step events are executed and then all draw events every frame.

When you step on the ground object whose step gets executed last (highest instance id) there is no object to override it and when drawing all objects see the value as true.

Using a local variabele instead should fix it.
3  Developer / Art / Re: GIFs of games being worked on on: November 10, 2015, 06:18:55 AM
4  Developer / Technical / Re: General thread for quick questions on: September 20, 2015, 10:22:04 AM
That worked very well, thanks!

And I know there's a lot more to it, and I'm currently figuring that out.

My wing lift is always straight up from the plane's perspective (transform.up) so when you make a 90 degree turn this force will indeed slow you down.
5  Developer / Technical / Re: General thread for quick questions on: September 20, 2015, 04:48:40 AM
In unity, how would I make air resistance (drag) greater or smaller depending on the collision of movement?

Let me try to illustrate what I mean:


I'm making an airplane by the way. I notice that when I make a turn while flying, I'm suddenly flying sideways because the velocity does not change in direction.
6  Developer / Design / RPG combat math on: December 14, 2014, 10:06:55 AM
Hi,

I'm making a turn-based RPG that kinda plays like a roguelike (No battle screen, the entire game is just turn based: It halts until you do something, and then all nearby entities get a turn to do something and so on) and now is the time that I need to start thinking about how to actually do the combat mechanics.
I want to keep it very simple, so I don't want too many attributes/stats. However, I want a weapon to possibly have more than just a "damage" attribute, just because that would make the game way too linear since the weapon with the highest number is always the best.
So right now I'm trying to think of wich stats I want and how I implement them in the "combat math". (The calculation for how much damage you do.)
Does anyone have any ideas or know anything about the core mechanics most RPG's use for combat. Is there some kind of standard for that?

Right now the only thing I could come up with is damage = random(player.attack + weapon.attack) - random(enemy.defence + emeny.armour) but I think that would be kinda lame and maybe a bit too random.

Suggestions please?  Beg

Thanks in advance!
7  Community / Writing / Re: Writing liar dialogues on: December 11, 2014, 10:14:56 AM
The easiest way would be to make sure the story they tell can not be 100% correct. But you need to keep this subtile ofcourse or else it would be to obvious. Make them tell details of wich the player knows they can not be true, or let them later tell stuff that conflicts with what they told before. If done right, only an alert player will spot it.
8  Developer / Technical / Re: Static reference to self. Bad practice? on: December 08, 2014, 01:51:24 AM
Thanks! I actually like that idea.
I think I will do something in between. Having a GameSession and keeping a static reference to it in my Game class. That looks a whole lot nicer than what I have now, but works just as easy.
9  Developer / Technical / Static reference to self. Bad practice? on: December 07, 2014, 02:55:54 PM
Hi,

When making games from scratch in C# I sometimes struggle with organizing the code in a way that I can have access to certain things where and when I need them. I found that putting a static reference to itself in my main class works pretty good, but I'm quiet sure it's very bad practice. Also, it doesn't look too good.
Code:
class Game
{
    public static Game self;

    public Game()
    {
        self = this;
    }
}

It's a bit like Singleton but worse actually.

However, it works great because you can always use references like Game.self.world and Game.self.items and other things like that.

What do you guys think about this way of doing things? How bad is it and what can you do to prevent having to do this except for passing a reference to every class as a parameter?
Pages: [1]
Theme orange-lt created by panic