Jump to content

  • Log In with Google      Sign In   
  • Create Account

Lactose!

Member Since 16 Oct 2013
Online Last Active Today, 04:00 AM

#5257377 Passing Setup class to get screen height

Posted by Lactose! on 15 October 2015 - 12:48 PM

Why do you think there's a problem with second.y? You create an instance of Second, but that instance is never used anywhere.

To find out where your error about invalid textures comes from (you should really copy error messages verbatim, not paraphrase them), you should check every SDL call you make. Currently, you seem to almost 10 SDL calls before your first SDL_GetError() call.

Basically, check the return values and see the first point it tells you something's wrong.

 

Also, this is a small enough program that I would definitely recommend you learning how to use a debugger (setting breakpoints, looking at variables and seeing the flow through your code, etc), if you don't already know how.




#5254960 Map map coordinates into grid reference id

Posted by Lactose! on 01 October 2015 - 05:18 AM

In the given example...

 

newX = (oldX + 10) / 10

newY = (30 - oldY) / 10




#5253905 sprite render is very slow

Posted by Lactose! on 24 September 2015 - 05:31 PM

If you have problems with your applications being slow, you should consider learning about/looking into profilers.

They can help show you which sections of your code is running slowly. Even if you don't know a solution to the slow part yourself, you can at least narrow it down and be able to post a lot more specific questions, which is likely to give you better replies and solutions.




#5252497 SDL Texture Invert

Posted by Lactose! on 16 September 2015 - 06:24 AM

What the diference between RenderCopy and RenderCopyEx?

SDL_RenderCopyEx just has some more options -- you can rotate the sprite around a given point, as well as flip the texture.

Other than that, they're identical, as far as I know.




#5252492 SDL Texture Invert

Posted by Lactose! on 16 September 2015 - 05:28 AM

Assuming SDL 2...

When rendering, use SDL_RenderCopyEx. Use SDL_FLIP_HORIZONTAL as the final parameter to flip the sprite horizontally.

See SDL_RendererFlip for the other values you can use.




#5251699 Help me find tutorial to make this type of game

Posted by Lactose! on 11 September 2015 - 06:18 AM


What Programming Language GameMake use?

http://lmgtfy.com/?q=What+Programming+Language+GameMake+use%3F

 

GameMaker uses its own language called Game Maker Language (GML).

 

Edit:

I don't mean to be rude, but please do a tiny bit of searching before asking a question. I could copy and paste your answer into Google and get an answer in shorter time than you'd wait for someone else to reply. Learning how to do your own research is very important.




#5250736 Need to be taught to make a 3D MMORPG

Posted by Lactose! on 05 September 2015 - 03:58 PM


So that being said spare me the criticism saying that 2 people can't make a 3D mmorpg alone

There's a reason why people say that.

 

There is no course teaching you how to make a 3D MMORPG.

There isn't a tutorial or guide, and if people try to sell you something, it's a lie and a scam.

 

You have basically no experience, you don't know any of the tools or programming languages, and you are 2 people.

This will not work. Try something else.




#5249899 Find tile coordinates within a given radius

Posted by Lactose! on 31 August 2015 - 08:49 AM

The images you listed could very well be a diamond pattern -- where abs(deltax) + abs(deltay) should never exceed the given radius, where deltax and deltay is distance from origin.

 

For more "proper" circles, you might want to have a look at https://en.wikipedia.org/wiki/Midpoint_circle_algorithm




#5249465 Code Review - Pong

Posted by Lactose! on 28 August 2015 - 08:51 PM


How can improve the update method? Because now it is updating way to fast even with a SDL_Delay(10)

In addition to Sean's post above -- fix your timestep




#5249321 What choose for first game?

Posted by Lactose! on 28 August 2015 - 04:31 AM

This looks like it's covered in the FAQ.




#5248469 Pointer Clarification

Posted by Lactose! on 24 August 2015 - 02:37 AM


void Goblin::Attack(int *targetHP)
{
targetHP-= 5;
}

Just pointing (har-har-har) out that this wouldn't work correctly.

Since targetHP is a pointer, you'd need to dereference it before modifying it.

*targetHP -= 5;




#5248428 What game engine would you recommend?

Posted by Lactose! on 23 August 2015 - 04:37 PM

I would hazard a guess that any of the top commerical game engines will be capable enough for this kind of game.

 

The question is rather are you currently capable of making this game? Even with game engines, it will be a lot of work.

Have you made any games before?

What kind of experience and skills do you have?

How many people do you have/will you have working on the project?




#5248292 sfml distance between player and enemy

Posted by Lactose! on 22 August 2015 - 03:53 PM

 

 


if i set my enemy to (200,50) and I go over the top of him, my distance will be 200

Then your bug isn't in the code you posted.

EIther your values going into the function are wrong (check in a debugger), or you're doing something wrong somewhere else.

 

It sounds like maybe you're always comparing to something that's at (0, 0). If the values change when you move the enemy, verify that your player position is correct (again, use a debugger).

 

 

I don't really know where to start looking. I am calling the function in my main update function like so:

 

enemy.EnemyDetectPlayer(player.playerPosition, enemy.enemyPosition);

 

and the position of each are vector2f

 

That's why I said to use a debugger.

Set a breakpoint inside the function, and step through line by line, inspecting each variable to see what it is.

 

Debugging is a fundamental skill -- the sooner you learn it, the better.

 

EDIT: A helpful link. Clicky.




#5248278 sfml distance between player and enemy

Posted by Lactose! on 22 August 2015 - 02:21 PM


if i set my enemy to (200,50) and I go over the top of him, my distance will be 200

Then your bug isn't in the code you posted.

EIther your values going into the function are wrong (check in a debugger), or you're doing something wrong somewhere else.

 

It sounds like maybe you're always comparing to something that's at (0, 0). If the values change when you move the enemy, verify that your player position is correct (again, use a debugger).




#5248257 What am i doing wrong (syntax)

Posted by Lactose! on 22 August 2015 - 12:13 PM

" is not the same as ''

(1x double vs 2x single)

 

 

EDIT: In future, please post the actual code instead of a picture of the code. Enclose it in the forums code tags to preserve formatting.






PARTNERS