Hey Asimov!

The Partridge Family were neither partridges nor a family. Discuss.
User avatar
Asimov
Posts: 814
Joined: May 19th, 2012, 11:38 pm

Re: Hey Asimov!

Post by Asimov » August 6th, 2012, 8:58 pm

Hi Chilli,

Well I got your code to work. Woo hoo.

Well you might say why I have got all those images in the folder and the reason is this. I have so far only put one image in my resource file for testing.

The image I have put in is the cities.
If you look at my code I have put this in

Code: Select all

//City.LoadSprite(L"data//City",50,38); //removed this line which loads from a file

City.LoadSpriteRes(IDR_CITY,50,38);
So now my class has the abiltiy to load from a class or a file, dual functionality.

I have added it to show you it working. By the way I haven't got all the levels sorted properly yet, and there are a few bugs to iron out, but have a go at the game and let your turrent get hit. I have a nice turret shield hit animation heh heh. You are supposed to have 3 sheilds, but there is no code to end the game when you get destroyed though LOL.

Right first of all even though the code didn't give an error my cities didn't show up at first and the reason for this was this. I loaded my png into the resource editor as a bitmap, and that won't work.
You have to load it in as an RC Data and then it works.

The reason it was important to have dual functionality is that it is easy to test pngs by just dropping them in, and then later adding them to the resources.

Now I going to do all my images now.

This is dead cool. Thanks Chilli.

Asimov
Attachments
09_Missiles - Resource.zip
(1.74 MiB) Downloaded 164 times
----> Asimov
"You know no matter how much I think I have learnt. I always end up hitting brick walls"
http://www.asimoventerprises.co.uk

User avatar
Asimov
Posts: 814
Joined: May 19th, 2012, 11:38 pm

Re: Hey Asimov!

Post by Asimov » August 6th, 2012, 11:13 pm

Hi Chilli,

Now I have got all my images in the game, well except for any new ones I might add.
Now this is the amazing thing. So far the filesize of the whole exe is only 1.52mb

It is attached for test purposes.

By the way it is now centred on the screen. I didn't write that code, but made use of a pre-made function.

Asimov
Attachments
Missile Command.zip
(1.43 MiB) Downloaded 161 times
----> Asimov
"You know no matter how much I think I have learnt. I always end up hitting brick walls"
http://www.asimoventerprises.co.uk

User avatar
Asimov
Posts: 814
Joined: May 19th, 2012, 11:38 pm

Re: Hey Asimov!

Post by Asimov » August 7th, 2012, 5:02 pm

Hi Chilli,

Since getting it to work in the last post I found a few problems.

If I loaded my turret png to 104 my program would crash on startup. Looked like some kind of memory error. I solved this by changing the turret png to 117 and then it didn't crash. What could cause this?
I wish I noted down the error number LOL.

Right this is another problem. I can run the exe fine on this computer and another windows 7 computer without problems, but if I run the game on XP it crashes with almost the same error above.
Any idea why this could be happening?

I message Joe Woodbury the guy who wrote the original code, and he said it was developed on Xp and so it shouldn't crash on xp. I wonder if I am doing something silly and causing a memory leak or something. Will post my code later so you can see.

EDIT: Ok here is my code. It works perfectly in windows 7 but not in xp.

Asimov
Attachments
10_Missiles - Centre.zip
(3.08 MiB) Downloaded 155 times
----> Asimov
"You know no matter how much I think I have learnt. I always end up hitting brick walls"
http://www.asimoventerprises.co.uk

User avatar
chili
Site Admin
Posts: 3948
Joined: December 31st, 2011, 4:53 pm
Location: Japan
Contact:

Re: Hey Asimov!

Post by chili » August 8th, 2012, 12:41 pm

Hmmm, I have no way of testing it so I don't know what's causing the problem. Your best solution would be to gain access to an XP system, install VC++, and debug your program there.
Chili

User avatar
Asimov
Posts: 814
Joined: May 19th, 2012, 11:38 pm

Re: Hey Asimov!

Post by Asimov » August 8th, 2012, 4:08 pm

Hi Chilli,

My thoughts exactly. I have a netbook here somewhere with xp on, so I might be able to test on that.
Strange that it worked fine before though.

The error was a memory exception, which I maybe thought was some kind of memory leak. I am not using malloc and I am using New so I can't see how that is happening though.

I am puzzled that when I loaded my png into 104 it crashed on my win 7 computer with a memory exception, then when I changed it to 117 it didn't crashed.

I am thinking perhaps I should rebuild my resource file from scratch and see if that solves it. Then try it on my netbook.

These are the kind of problems which are hard to track down.

Asimov
Attachments
exception.jpg
exception.jpg (92.1 KiB) Viewed 3244 times
----> Asimov
"You know no matter how much I think I have learnt. I always end up hitting brick walls"
http://www.asimoventerprises.co.uk

User avatar
LuX
Posts: 1492
Joined: April 22nd, 2012, 12:33 pm
Location: Finland

Re: Hey Asimov!

Post by LuX » August 8th, 2012, 9:42 pm

Were you able to run other programs on it?

I mean it could be that the XP machine's graphics card doesn't support it, so you might need to use the other version of the framework.
ʕ •ᴥ•ʔ

User avatar
Asimov
Posts: 814
Joined: May 19th, 2012, 11:38 pm

Re: Hey Asimov!

Post by Asimov » August 8th, 2012, 9:59 pm

Hi Lux,

The game worked fine loading from files. It only stopped working when it loaded from resource. So it is not a graphics bug.

However it works fine on both my windoze 7 machines. strange.

Asimov
----> Asimov
"You know no matter how much I think I have learnt. I always end up hitting brick walls"
http://www.asimoventerprises.co.uk

User avatar
chili
Site Admin
Posts: 3948
Joined: December 31st, 2011, 4:53 pm
Location: Japan
Contact:

Re: Hey Asimov!

Post by chili » August 9th, 2012, 3:54 am

What do mean by 104 or 117???
Chili

User avatar
LuX
Posts: 1492
Joined: April 22nd, 2012, 12:33 pm
Location: Finland

Re: Hey Asimov!

Post by LuX » August 9th, 2012, 8:34 am

I think he means the resource ID by those values. Maybe they are already in use or something?
ʕ •ᴥ•ʔ

uglypie
Posts: 21
Joined: May 5th, 2012, 5:05 pm

Re: Hey Asimov!

Post by uglypie » August 9th, 2012, 3:03 pm

chili wrote:You want this... don't you... >: )
Let the hate flow through you!

Post Reply