Helo7777

GDNet+ Basic
  • Content count

    170
  • Joined

  • Last visited

Community Reputation

693 Good

About Helo7777

  • Rank
    Member

Personal Information

  • Interests
    Business
    Education
    Programming
  1. some basic socket questions

    I don't have experience doing this in android or Java but I'd cut your program back to sending simple text for testing sake rather than an image. As others have said there are many variables in networking that can make it difficult such as routers and firewalls that can prevent an otherwise working app from sending/receiving. I did a quick google search and grabbed some links that may assist with simple text sending/receiving. http://www.oracle.com/technetwork/java/socket-140484.html and http://stackoverflow.com/questions/7384678/how-to-create-socket-connection-in-android
  2. School Project Game

    Nice! But I suggest you move this post to the indie project section :)
  3. Well my first example might look like in Java: class SceneObject { SceneManager manager_; public SceneObject(SceneManager manager) { manager_ = manager; } void update() { //... //something happended manager_.onEvent(this); } } class SceneManager { public void onEvent(SceneObject o) { //handle the event } } And my second example might look like: interface EventCallback { public void onEvent(SceneObject o); } class SceneObject { ArrayList<EventCallback> listeners_ = new ArrayList<>(); void addListener(EventCallback listener) { listeners_.add(listener); } void update() { //... //something happended for (EventCallback c : listeners_) { c.onEvent(this); } } } class SceneManager implements EventCallback { public void onEvent(SceneObject o) { //handle the event } }
  4. The player shouldn't be responsible for what happens to the bullet once it has been fired, and the player shouldn't be responsible for the effect it will have in the world either. The actual updating and rendering of the bullet can be done within the bullet class its self (but managed at a high level from the main class or "scene manager"). The hit detection should be handled by the scene manager too. Basically what I'm trying to say is keep your objects separate from each other. It will make behaviors easier to manage and keep your code clearer. If you have an object that needs to notify the scene of an event then there are a few ways of dealing with that without copying data everywhere. One way would be for your scene objects to know about the scene manager so they can call some event function. Another and cleaner way would be to have the scene manager register for object events. Then the objects just notify whoever is listening. This design helps to abstract things out and reduce dependencies.
  5. Car skidding behavior

    If you're really keen and those interested, there is a rather large and details series about the physics of car racing http://phors.locost7.info/contents.htm ...I know, it's way beyond the scope of this thread but an interesting read anyway :)
  6. I don't have experience with godot so I can't help you there unfortunately. There are a couple of things you can do in your layout file to help with different sized screens. Have a look into "RelativeLayout" or "LinearLayout" with "weightSum" and "layout_weight". These will allow you to place things with percentages that will scale with the screen
  7. Glad you got it. Lots of googling ? and experimentation
  8. The output of that intent (once th user has selected a file) is a URI. The uri is a path to a file. You can then load and manipulate the data in that file however you please. But if "Intent.ACTION_GET_CONTENT" doesn't fit your needs then probably best not to shoehorn it in and instead get your original plan to work.
  9. By connecting the gallery folder I assume you just mean loading all files in the folder defined at getFromSdcard(). In that case then yes there is a way to test this, which is put break points in that function and see if the file object is null or not. That will at least get you started as to why you are seeing blank. Put a breakpoint in onCreate(). Is the activity actually being created? I don't believe this is something you can do from a layout file alone, Java code will be needed. And use of the debugger is vital. Once you have determined your objects aren't null, try calling "notifyDataSetChanged()" on your adapter at the end of getFromSdcard(). See the developer documentation for info https://developer.android.com/reference/android/widget/BaseAdapter.html Also put a breakpoint in ImageAdapter::getView(). If your code is not reaching that then your files are not being rendered. Instead of rolling your own gallery/file selector have you thought about using the built in one using "Intent.ACTION_GET_CONTENT"? See this link to get you started http://stackoverflow.com/questions/17765265/difference-between-intent-action-get-content-and-intent-action-pick
  10. Where is onTouchEvent called?

    Yes it comes from within built in classes and function so you probably wont be able to see exactly how/where it is called. It is called automatically by the system when a touch event occurs. You don't need to do anything more than override that function to receive and respond to the event. The android developer documentation is pretty handy. See https://developer.android.com/training/gestures/detector.html and https://developer.android.com/reference/android/view/View.html for onTouchEvent descriptions
  11. +1 frob, if I could upvote I would but for whatever reason my browser won't do it. GrumpyOldDude, if you could answer frobs dot points then that will eliminate some potential problems.
  12. How to start Working towards making games.

    Sounds like you have a solid game idea there but you're probably a few steps ahead. A quick Google Search with the keywords "c++ 2d opengl game tutorial" will throw up many results at you that should give you a nice place to start. This one I found is for pong https://noobtuts.com/cpp/2d-pong-game Pong is a pretty good place to start as you'll get a feel for most essential game design and creation skills such as simple game design, collision detection, player input etc...then when you're done you can try your hand at AI and play the computer. For that tutorial any windows machine will do. Just download visual studio and away you go! C++ is a pretty common game programming language but the others you have mentioned are common too. For example pygame for python might be another place to look after pong. https://wiki.python.org/moin/PyGame Unity3d https://unity3d.com is a very popular game engine and is great place to move onto after some smaller projects. You won't have any troubles finding examples and tutorials for it.
  13. Examples of interesting AI in games

    I've always enjoyed the AI in F.E.A.R. The AIs tactics felt dynamic and exciting...haven't played it in a while but I assume it still holds up. There is a great paper on how they achieved it which I really enjoyed reading. 3 states and a plan
  14. If you are really going for speed, create an enum of all your items from 0 -> n-1. Then have an array of n size and index it using the type enum. Should perform better than a hashmap. What the array holds is upto you but could simply be an int for the type count, or a struct holding both a type count and references back to the items.
  15. I've posted something similar in another thread but YouTube has plenty of great talks you can put into practice about design and best practices. Best of all they're free! For example, Sean Parent C++ seasoning Basically anything from Sean Parent, Hurb Sutter and Scott Meyers is a good watch and you'll learn heaps