Advertisement Jump to content
  • Advertisement


  • Content Count

  • Joined

  • Last visited

Community Reputation

2113 Excellent

About DiegoSLTS

  • Rank
  1. DiegoSLTS

    getting the job done

    I don't think concept art could infringe copyrights. As long as the final work is original you can use things you found to make some prototypes.   Maybe you don't find copy pasted concept art because noone cares to share them. It's probably better for a company to share some concept art of something really original than a quick and dirty character made stretching a Mario image. Also, concept art and prototypes are usually private and most companies have a confidenciality policy that prevent them to be leaked to the public, or any other company could steal the idea.
  2. DiegoSLTS

    Platform game map like yoshi's island

    I don't know exactly how those things were done in Yoshi's Island, but I don't think that it used a polygons. SNES hardware is really old and the development was made directly on assembly language and there are no abstractions like "polygons", it's all about bytes, bits, registers and everything depended a lot on the hardware.   Also, consoles of that time did a lot of the work with hardware, so probably the detection was made by the hardware checking if sprites overlaped. I know the NES did it that way, so I guess the SNES did something similar.   The levels were also drawn in a different way than modern games, again depending a lot on the hardware, so it probably wasn't a full level drawn completely, the hardware wouldn't support such thing and it would make a lot of wasted resources.   If you want info to make something similar to Yoshi's Island I'd recommend you find a modern game that's already similar and research how that game was made. It would be a lot easier to find information that way, unless you want to make a game for the SNES too (you can write one and play it on emulators).
  3. I don't have a lot of experience with animations, but I read that you can't edit animations on runtime inside a script.   Anyway, if you'll setup all the transitions just to play it once and then rollback it sounds like you're doing a lot of unnecesary work. I'm pretty sure you can just play the animations in the order you want, use the Animation's "Play" method to start a new animation when the current one has finished or go back to idle if it's the last one. Check in the Update method if the animation finished, here someone asked how to do it and it looks really simple:
  4. DiegoSLTS

    OO where do entity type definitions go?

    If you want to make something that's pure OOP and want classes for Orc, Elf and Goblin then they should be classes that inherit all from the same base class.   Inheritance and polymorfism doesn't force you to add or redefine extra variables of methods, you can make something like: class A { int value; A(int value){ this.value = value } } class B { B():A(2){} } and it's completelly valid, but kind of unnecesary.   Anyway, if those type of entities have all exactly the same behaviour you really don't need more clases. If you want to make the diferent entities explicit in code you can have a factory class with methods that returns an "Orc", "Elf" or "Goblin". Not an instance of Orc, Elf or Goblin classes, just an instance of the entity class with all the values that represent the correct entity. This way you can do something like: class Factory { static Entity newOrc(){ return new Entity(/* set the type to orc */); } static Entity newElf(){ return new Entity(/* set the type to elf */); } static Entity newGoblin(){ return new Entity(/* set the type to globin */); } } void main () { Entity orc = Factory.newOrc(); Entity elf = Factory.newElf(); Entity goblin = Factory.newGoblin(); }
  5. DiegoSLTS

    Java how to do this

    The "replaceAll" method on the string class in Java affects the string on which you called the method. It searches every match of the first argument (used as a regular expression) and replaces them with the second parameter. Look at the documentation here:,%20java.lang.String%29   I suppose enLang is an array of strings. In that case you can probably do something like: for(int i =0; i<enLang.length; i++) { enLang[i] = petLang[i]; } And now enLang has all the values replaced by petLang. That's what you want?   EDIT: OK, after reading what preg_replace does I think I understood what you want to do. There's no function that does exactly that, and it's harder than it looks in Java.   You have some text that you want to translate, and you want to search every ocurrence of each english word and replace that word with it's counterpart on another language.   The first thing you have to consider is that strings in Java are immutable, so replaceAll returns a new string using what "english.getText().toString()" and replacing every ocurrence of enLan with petLang. This means that if you always use "english.getText().toString()" on each iteration you're using the english text, not the modified text of the previous iteration.   So, first, you need to do something like this: string strOutput = english.getText().toString(); for(int i =0; i<enLang.length; i++) { strOutput = strOutput.replaceAll(enLang[i], petLang[i]); } And now if "english.getText().toString()" returns "hello world", strOutput will start with "hello world" as the value, then "<hello in petLang> world" and later "<hello in petLang> <world in petLang>".   But, this has one issue. I guess preg_replace in php does only one run over the string, so a word that was replaced can't be replaced by another word. I don't know what "pet" language is, so I'll give an example on an imaginary language.   Imagine again the "hello world" string, and imagine that in the imaginary language "hello" is translated as "world", and "world" is translated as "hello". The first iteration on the string will search for all ocurrences of "hello" and replace them with "world", so strOutput will have the value of "world world". Now on the next iteration all ocurrences of "world" will be replaced by "hello", so your output is "hello hello" in the end instead of "world hello".   So, the proper way to do it would be to split the string in an array of words (, translate each word and then join every word in the same order. There's no equivalent for PHP's "join", but it's easy to implement.
  6.   Can't the OP just get some sort of bounding box/convex hull and tests each point if it lies inside the circle? I guess this is a weaker form of collision detection, but it might be tenable given the point-in-circle test is really computationally simple.   Yes, in most cases it might work, but you can have two points outside of the area and the line between them could intersect with it anyway. It depends on how accurate the detection should be, and that depends on the gameplay.   In some games modeling the colision areas as circles is good enough and in those cases the colision detection requires the same work as checking for a point inside a circle, but instead of checking if the point is at a distance less than the range, you check if the distance between them is less than the range plus the radius of the target area.
  7. I'm not sure if the OP wants to detect if a point is inside a circle. He wrote about a "target" and in games a target is usually some kind of object that has a size, so checking a point might give wrong results. To the OP, if you want to do that thing I said you should research about collision detection, so you can detect a valid target even if only a part of the target is at a certain distance of the weapon.
  8. I think you need to set the surface blend mode ( to SDL_BLENDMODE_BLEND
  9. DiegoSLTS

    Questions about bullet physics

    To me btBoxShape does look like the shape you want, AABBs are boxes of different sizes, and that bullet object let's you specify each length individually. The "axis aligned" can be done by just not rotating the shapes. Why do you think it doesn't look like what you need? That's for a complete physics simulation, the sphere bounce because rigid shapes bounce. For controlling a player you usually don't want a complete physics simulation. Bullet let's you define objects that are affected by every force and others that don't, search abount "kinematic" objects. Also, check this class I think this is what you're asking:
  10. DiegoSLTS

    Operator overloading +=, -=, *=

    Doing different thigns for "+" and "+=" operators is a good way to write unmaintainable code.   Anyone expects that "A += B" is the same as "A = A + B", if you're not working alone you'll probably have to explain the difference between both more than once, and everyone will hate it when a bug is introduced for mistaking the operands.   I'll make something consistent and self documented, "+" and "+=" operators should do the same (either both modify the vector or both return a new MyVector) and add another explicit way to achieve the other behaviour... For example, if "+" adds to itself, you can have a MyVector constructor that takes a vector as "base" and another vector as the increment; or a static method that takes the same 2 vectors, makes a copy of the first one and adds the second one; or even an instance method called "addToNew" that works like your "+" operator in the first post.
  11. Isn't using globals actually the reason why you can't force the initilization order? If they must be initialized in a certain order then make an explicit dependency, make sure the second system needs the first system, set it as a parameter in the constructor. This way you can't write code that mix them, you can't create the second system without a reference of the first.   Your solution with the systems declared in a certain order as private members of an enclosing class is error prone too, anyone can mix the list and you'll spend a lot of time tracking that error. The mixed code looks like working code, so the programmer fixing the new bug wouldn't look at it at first. With that approach you can only comment a lot and expect the comments to be updated if anything changes, and expect everyone to read the comments.
  12. DiegoSLTS

    DC programming question

    You need the Dreamcast SDK:
  13. DiegoSLTS

    What's wrong?

      Guys, that's what the link I shared says. It even explains why this issue happens: "A" class being equivalent to Rochthoek, "B" being Venster, "C" being FlexRochthoek and "D" being VensterMetTitel.   In your case, you're not doing multiple inheritance but are doing virtual inheritance, so that's equivalent to: D(int i) : A(i), B(i) { or VensterMetTitel(int h, int b) : Rochthoek(h,b), Venster(h,b) {
  14. DiegoSLTS

    What's wrong?

    Read again my answer, I gave you a solution to do virtual inheritance without default constructors and the link where I found it. Or search for "virtual inheritance with default constructor" in google.
  15. DiegoSLTS

    What's wrong?

    When you write "class FlexRechthoek : virtual public Rechthoek" you're using virtual inheritance (I just learned about it, I didn't know you could use the "virtual" keyword like that). Are you sure that's something you want?   I removed those "virtual" (that one on another below) and the code compiles. I've found that virtual inheritance is used to solve the multiple inheritance "diamond" problem, and you're not doing multiple inheritance here.   EDIT: Sorry, you are using multiple inheritance, so that's probably what you want. Look here:   When using virtual inheritance without a default constructor for the base class you need to make the call explicit. Something like this: VensterMetTitel(int h, int b, string titel) :Rochthoek(h,b), Venster(h, b), titel(titel) Anyway, it looks like a really complex inheritance for some code that handles 2 ints and prints out some "*", do you really need something that complex?   EDIT2: Haha, sorry again, you're NOT doing multiple inheritance, VensterMetTitel inherits from Venster and Venster inherits from Rochthoek, FlexRochthoek is never used. So, check if you really need those "virtuals", and if you do, add the explicit call to the Rochthoek constructor.
  • Advertisement

Important Information

By using, you agree to our community Guidelines, Terms of Use, and Privacy Policy. is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!