boblehest

Member
  • Content count

    6
  • Joined

  • Last visited

Community Reputation

106 Neutral

About boblehest

  • Rank
    Newbie
  1. Card Zone placement problem

    Ok, that's kinda what I assumed, it just didn't make sense to me that the 2 if blocks set different y values (I assume those are x/y values for the card position), since if they're on the same row, they should have the same y value, right? sprite_index=spr_mini sound_play(snd_summon) if not  collision_point(x, y, obj_mzone1,1,1) { x = 339; y = 326; } // The last part of this is redundant, you just checked if not collision_point for mzone1 above, if that failed, then there was a collision. // There is no need to check again                             v else if not  collision_point(x, y, obj_mzone2,1,1) and collision_point(x, y, obj_mzone1,1,1) { x = 416; y = 400; // why is this not 326 as well? } First, I don't know why your code fails to work the way you intended, I don't think you provided all the relevant code (I don't know Game Maker though.) Now for some pseudo code for a better approach: // I don't know how you organize your objects in Game Maker, so I'm kinda coding while blind here. // Somewhere, you should have stored information about zone sizes, and on screen positions. // You should never use your objects' on screen positions to "store" information. I hope you can see the difference here.   // Store these variables somewhere.. spell_zone_slots = 5; spell_zone_base_x = 339; spell_zone_spacing = 80; // Horizontal space between cards spell_zone_base_y = 326; spell_zone_slots_taken = 0;   // card_id would be some identification for that specific card instance. function add_card_to_spell_zone(card_id) {   if (spell_zone_slots_taken >= spell_zone_slots) {     // No more room, do whatever return;   } ? // In case you need to check which card is in slot x, you can check spell_zone_cards[x]. I don't know if you need to or not.   spell_zone_cards[spell_zone_slots_taken] = card_id;   card_id.x = spell_zone_base_x + spell_zone_spacing * spell_zone_slots_taken;   card_id.y = spell_zone_base_y;     spell_zone_slots_taken += 1; } I hope you get the concept here. Store the slot state in variables so you know what slots are taken, you should not have to check for any collision for this.
  2. Card Zone placement problem

    You should probably follow some tutorials, because your approach is a bit misguided. I could tell you straight away that collision checking is just a very bad approach to this problem, and that you should be using arrays here.
  3.   I wouldn't make a habit of depending on implementation defined behavior like that.
  4. C++ As First Language

    [quote name='kunos' timestamp='1342004691' post='4957984'] To recap, I'd suggest you to take a step back, and consider C# and especially Go as your introduction to programming. [/quote] Wait, what? You recommend he doesn't start with C++, but C# is OK? I'd NEVER recommend C# to anyone, unless they want to do what's best for Microsoft, and not for themselves.
  5. Ideas for how to improve code

    [quote name='Cornstalks' timestamp='1335829557' post='4936226'] [code]bl = (boolRep != 0) ? true : false;[/code] which is slightly common [/quote] Really? I've actually seen code like that several places, in the worst case (imo), like this: [code]return isEnabled ? true : false;[/code] Which of course is equivalent to [code]return isEnabled;[/code] The only different is that the first one is harder to understand, and takes longer to type.
  6. Common Screen Resolutions?

    [quote name='cgpIce' timestamp='1333593288' post='4928366'] Hmm, well the main reason I asked was due to the background image in my menu not scaling too well when you reach higher resolutions, so I think my best bet is to have the menu itself have a set resolutions (within the screen) and have it choose the best based on your selected resolution, then surround the remaining with black, the game itself however will be able to cover your whole screen just fine, that sound just enough? or should I perhaps work at a different angle? [/quote] IMO forcing a low resolution isn't a viable solution to your problem, you might as well scale the background image in that case.