Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Windows / Help getting some code working HELP!

Author
Message
AGK C++
11
Years of Service
User Offline
Joined: 6th May 2013
Location:
Posted: 6th May 2013 02:24
Im doing a game for my college Final and im having a little trouble in getting the enemy to fire at me and the player to fire and damage the enemy, i believe i have the right code but doesnt seem to work. Im new at this so any help would be appreciated. Thanks

PS: some code is documented cause i have a mess and im trying to get it working so i can focus later on organizing everything

ADVR

Attachments

Login to view attachments
Ancient Lady
Valued Member
20
Years of Service
User Offline
Joined: 17th Mar 2004
Location: Anchorage, Alaska, USA
Posted: 6th May 2013 17:03
Most of us don't want to look at entire projects unless it is the only way. Especially when it is for a school assignment. None of us should do a full debug on such a project.

Tell us what version of AppGameKit you are using, which Tier (I am guessing Tier 2 based on your user name) and which platforms.

Then show us some of the code that you think is having a problem.

Cheers,
Ancient Lady
AGK Community Tester and AppGameKit Master
AGK C++
11
Years of Service
User Offline
Joined: 6th May 2013
Location:
Posted: 7th May 2013 04:09
this is my problem they shots come from the bottom instead of coming from the top. Any help or tips are appreciated.Thanks

//Asteroid
if(asteroid_x <= 0) {
asteroid_x = SCREEN_HEIGHT;
asteroid_y = agk::Random(1, SCREEN_WIDTH);
points += 1;
}

asteroid_x -= speed / 5;
agk::SetSpritePosition(ASTEROID_INDEX, asteroid_y, asteroid_x);


//Collision between a ship and an asteroid
if(agk::GetSpriteCollision(SHIP_INDEX, ASTEROID_INDEX)) {
points -= 2;
asteroid_x = SCREEN_HEIGHT;
asteroid_y = agk::Random(1, SCREEN_WIDTH);

ADVR
Ancient Lady
Valued Member
20
Years of Service
User Offline
Joined: 17th Mar 2004
Location: Anchorage, Alaska, USA
Posted: 7th May 2013 16:42
The AppGameKit screen coordinates originate in the upper-left of the display, not the lower-left.

So, SCREEN_HEIGHT is pointing to the bottom of the display, not the top.

Cheers,
Ancient Lady
AGK Community Tester and AppGameKit Master

Login to post a reply

Server time is: 2024-11-21 12:29:17
Your offset time is: 2024-11-21 12:29:17